linux list directory size, list directories and their sizes
linux list directory size – list directories and their sizes
shazam! here you go:
du -sh *
For example:
[dnumtwo@yomamasvm targets]$ ls -al total 65 drwxr----- 16 dnumtwo dnumtwo 16 Aug 7 2013 . drwx------ 3 dnumtwo dnumtwo 57 Apr 1 09:22 .. drwxr----- 3 dnumtwo dnumtwo 3 Aug 7 2013 host drwxr----- 6 dnumtwo dnumtwo 6 Aug 7 2013 application drwxr----- 4 dnumtwo dnumtwo 4 Aug 7 2013 repository drwxr----- 3 dnumtwo dnumtwo 3 Aug 7 2013 dnumtwo_apache drwxr----- 3 dnumtwo dnumtwo 3 Aug 7 2013 dnumtwo_console drwxr----- 3 dnumtwo dnumtwo 3 Aug 7 2013 weblogic_domains [dnumtwo@yomamasvm targets]$ du -sh * 23K host 893K application 49K repository 232K dnumtwo_apache 256K dnumtwo_console 17K weblogic_domains
the du command parameter breakdown:
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G) -s, --summarize display only a total for each argument
here’s the man page for the du command if you’re interested.