Monday, March 22, 2010

Displaying only the subdirectories from the current directory

some time U don't remember the name of the subdirectory U want to go to.
and in the jungle of files and directories it is easier if you could see
only the directories.

put the following function in your env file 

dir()
{
  ls -l |awk '{ if ( substr($1,1,1)== "d") {print}}'
} 
 
 
Here is an easier command to list sub-directories alone in directories
ls -l | grep ^d 
 
Again Another tricky way
ls -d */

No comments:

Post a Comment