Articles: Listing Only Directories In Linux

Posted by: vishwanath on 06/20/2002 - 12:19 AM

1. This can be done using "awk" as follows
ls -al | grep '^d' | awk ' { print $9 } '

2. Second method can be achieved using "cut" command
ls -al | grep '^d' | cut --delimiter=":" -f2 | cut --delimiter=" " -f2