[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ProgSoc] Listing directories





On Nov 11, 2007 3:15 AM, John Elliot <jj5@xxxxxxx> wrote:
I'm trying to figure out how to use 'ls' to list only the directories in
the current directory, but I can't figure it out. :P

On Windows the equivalent command would be: dir /ad

Can someone throw me a bone?

ls -l | grep "^d" | awk '{print $9}'

Adding this to the end will strip off the trailing slash, if you need that:
         | sed "s/\/$//"



-Peter