Tuesday, February 24, 2009

marks in vim - bookmarks

- Go to a line where you want a mark and press mx - this will create a bookmark

( x can be any alphabet from a-z)

- Now navigate away from that place. If you need to get back to the earlier cursor location press "`x" (back-tick and x)

- You can set multiple "marks" in a single file and navigate using back-tick and the alphabet used to create a mark

Monday, February 16, 2009

Cron entry for other users

Execute the following as root :

cat /var/spool/cron/ssinghal

where ssinghal is the user name

Friday, February 6, 2009

Sed - Deleting lines matching a pattern

sed -i '/.*log$/d' file_names.txt

Deletes all the lines ending with "log" from the file "file_names.txt"