Skip to main content
additional information
Source Link
Dennis Williamson
  • 109.2k
  • 19
  • 172
  • 190

If you want to show all the directories in the current directory:

$ du -sh */
788K    foo/
500K    bar/
931K    baz/

To show them starting from another directory:

$ du -sh /path/to/dir/*/
48K     /path/to/dir/dir1/
4.0K    /path/to/dir/dir2/
6.7M    /path/to/dir/dir3/
20K     /path/to/dir/dir4/
8.0K    /path/to/dir/dir5/
44K     /path/to/dir/dir6/

If you want to make sure directories with names starting with a dot are included do shopt -s dotglob first.

If you want to show all the directories in the current directory:

$ du -sh */
788K    foo/
500K    bar/
931K    baz/

To show them starting from another directory:

$ du -sh /path/to/dir/*/
48K     /path/to/dir/dir1/
4.0K    /path/to/dir/dir2/
6.7M    /path/to/dir/dir3/
20K     /path/to/dir/dir4/
8.0K    /path/to/dir/dir5/
44K     /path/to/dir/dir6/

If you want to show all the directories in the current directory:

$ du -sh */
788K    foo/
500K    bar/
931K    baz/

To show them starting from another directory:

$ du -sh /path/to/dir/*/
48K     /path/to/dir/dir1/
4.0K    /path/to/dir/dir2/
6.7M    /path/to/dir/dir3/
20K     /path/to/dir/dir4/
8.0K    /path/to/dir/dir5/
44K     /path/to/dir/dir6/

If you want to make sure directories with names starting with a dot are included do shopt -s dotglob first.

fixed typos
Source Link
Dennis Williamson
  • 109.2k
  • 19
  • 172
  • 190

If you want to show all the directories in the current directory:

$ du -sh */
788K    foo/
500K    bar/
931K    baz/

To show them starting from another directory:

$ du -sh /path/to/dir/*/
48K     ../path/to/dir/dir1/
4.0K    ../path/to/dir/dir2/
6.7M    ../path/to/dir/dir3/
20K     ../path/to/dir/dir4/
8.0K    ../path/to/dir/dir5/
44K     ../path/to/dir/dir6/

If you want to show all the directories in the current directory:

$ du -sh */
788K    foo/
500K    bar/
931K    baz/

To show them starting from another directory:

$ du -sh /path/to/dir/*/
48K     ../dir1/
4.0K    ../dir2/
6.7M    ../dir3/
20K     ../dir4/
8.0K    ../dir5/
44K     ../dir6/

If you want to show all the directories in the current directory:

$ du -sh */
788K    foo/
500K    bar/
931K    baz/

To show them starting from another directory:

$ du -sh /path/to/dir/*/
48K     /path/to/dir/dir1/
4.0K    /path/to/dir/dir2/
6.7M    /path/to/dir/dir3/
20K     /path/to/dir/dir4/
8.0K    /path/to/dir/dir5/
44K     /path/to/dir/dir6/
Source Link
Dennis Williamson
  • 109.2k
  • 19
  • 172
  • 190

If you want to show all the directories in the current directory:

$ du -sh */
788K    foo/
500K    bar/
931K    baz/

To show them starting from another directory:

$ du -sh /path/to/dir/*/
48K     ../dir1/
4.0K    ../dir2/
6.7M    ../dir3/
20K     ../dir4/
8.0K    ../dir5/
44K     ../dir6/