Showing posts with label bash. Show all posts
Showing posts with label bash. Show all posts

05 September 2008

nice article: linux backup/reinstall

Linux Get list of installed software for reinstallation / restore software
http://www.cyberciti.biz/tips/linux-get-list-installed-software-reinstallation-restore.html

02 September 2008

my nice .vimrc

syntax on
set number
colorscheme delek

au FileType python source ~/.vim/scripts/python.vim

"highlight RedundantSpaces ctermbg=red guibg=red"
""match RedundantSpaces /\s\+$\| \+\ze\t\|\t/"
" line numbers on/off ctrl+n ctrl+n"
:nmap :set invnumber
" "autoindent on/off"
:nmap :set invautoindent
" " Suche NICHT case-senitiv, außer ein Grossbuchstabe steht im Suchmuster"
" " SmartCase, SMARTcase, smartCASE, SmArTcAsE, sMaRtCaSe, smartcase"
set ignorecase
set smartcase
" " Während Eingabe eines Suchmusters bereits suchen (inkrementell)"
" " Alle zu einem Suchmuster passenden Textstücke markieren (highlight)"
set incsearch
set hlsearch
"
:map :nohl
:imap :nohl i
":map :w!:!ispell -d ngerman -w ÖÄÜöäüß %:e! %

29 August 2008

linux/unix: list files with full path

what to do if you need to list files with their full paths?

ls won't do the job at all. The solution: use the find command.

find reservation -type f -name "*.py"

13 August 2008

useful commands in the unix world part 1

This list will be sporadically updated...

history | awk '{print $2}' | sort | uniq -c | sort -rn | head

file /path/to/file

Some links:

05 August 2008

grep and regular expressions

How to use grep with a resonably simple regexp, but which enables me to use OR? I mean, matching A OR B??? Got it... see the example:


cat /var/log/syslog | grep 'vpnc\|wlan0'


See the grep man page (type man grep at the prompt)


Basic vs Extended Regular Expressions
In basic regular expressions the meta-characters ?, +, {, |, (, and ) lose their special meaning; instead use the backslashed versions \?, \+, \{, \|, \(, and \).

Links:
http://www.amk.ca/python/howto/regex/regex.html
http://analyser.oli.tudelft.nl/regex/index.html.en

27 May 2008

Using dates on your filenames

A nice way to use the output of the date command to name your filenames:

cp test.sh tesh.sh.$(date +%Y%m%d-%H%M%S)

now it should be ok!