ls -l (include both directories and files)
ls -l | grep -v ^d (include only files in listing)
ls -l | grep ^d (include only directories in listing)
Wednesday, April 23, 2008
List only Directory/Files in ls command
Posted by Vishnu Agrawal at 10:48 AM 1 comments
Tuesday, April 22, 2008
Read latest file in vi editor
In my daily routine on solaris box, i have to read the latest file in vi. For this i have to run below 2 commands:
ls -ltr
vi filename
I get the latest file name with ls -ltr command (last file in the list) and then vi to open this file.
vi `ls -ltr|tail -1|awk -F" " '{print $9}'` (includes directory listing)
vi `ls -ltr|grep -v ^d|tail -1|awk -F" " '{print $9}'` (ignores directory listing)
or
vi `ls -ltr|tail -1|cut -d":" -f2|cut -d" " -f2` (includes directory listing)
vi `ls -ltr|grep -v ^d|tail -1|cut -d":" -f2|cut -d" " -f2` (ignores directory listing)
Posted by Vishnu Agrawal at 11:53 AM 0 comments
Thursday, April 3, 2008
Location of firefox cookies ?
All the firefox cookies are stored in cookies.txt at C:\Documents and Settings\Windows login/user name\Application Data\Mozilla\Firefox\Profiles\profile folder
Posted by Vishnu Agrawal at 4:48 PM 1 comments
Labels: cookies