Sunday, April 25, 2010

To find zombie process

Use the following commands to view zombie process:

ps auxw | grep -i "z"

or

ps aux | awk '{ print $8 " " $2 }' | grep -w Z
Read More !

Thursday, April 22, 2010

Useful ls commands

sort output by file modication time : ls -lt
sort output by file modication time (reverse order) : ls -ltr
sort output by file size : ls -lS
sort output by file size (reverse order) : ls -lSr
sort output by filename extension : ls -lX
sort output by filename extension (reverse order) : ls -lXr
sort output by filename extension (show only files) : ls -1X
Read More !

Friday, April 9, 2010

To set line number in vi or vim

To display line number :set number
To turn off line number :set nonumber
Read More !

Sunday, April 4, 2010

Determine if given date is in DST

GNU date can give you the timezone for a date...
date -d '2009-03-02' '+%Z'
Read More !

Monday, January 18, 2010

samba and htpasswd

to create smbpasswd : smbpasswd -a $USER
to delete user : /usr/bin/htpasswd -D /path to htpasswd file/file $USER
to add new user : /usr/bin/htpasswd -mb /path to htpasswd file/file $USER $PASS
Read More !