sureshmsi.co.nr

Posts Tagged ‘How to list only directories in linux console

How to list only directories in linux console

Posted by: sureshm on: December 2, 2007

Well, we know how to list files and directories in console. Yes ‘ls’ is enough.
The ‘ls’ will display all files and directories. To list only directories use :
[ myEmpire$]: ls -d */
This will do the trick.
To list only directories, use any one of the following commands.
# ls -d [...]