List only the directories October 19, 2005Posted by Carthik in commands, snippets, ubuntu.
I had a trivial problem today where I had a huge list of files in a directory, and other directories within the directory. I was looking for a specific directory and wanted to get the files out of the way. I wanted a listing of the directories within the current directory and nothing more. Luckily, with a little experimentation I was able to figure out how to do this :
$ ls -l | grep “^d”