Wednesday, March 31, 2010

Boot Time of a linux box

Do you want to know the time when a linux machine was started/booted? It's stored in /proc/stat. For easy use, in the standard unix time format display,here's a 1 liner to print it out, in your local timezone:
perl -ne 'print scalar localtime $1 if /^btime (\d+)/' /proc/stat

Ref

Thursday, January 7, 2010

vi editor word auto complete

In vi editor, When you start typing a word, you can press "Cntrl+n" to search through all words in the current document that begin with the characters you've begun typing. this only searches the current file.

"Cntrl+P" is used for displaying list of matching keywords.

Followers