Saturday, April 28, 2012

How to use 'ls' command to list only directories?

# ls -ld */
(or)
# ls -lp | grep ^dr
(or)  
# ls -pl | grep /$


To display the size of each folder listed above:

# ls -ld */ | awk '{print $9}' | xargs du -sh

No comments:

Post a Comment