If you want to get a list of the directories and their sizes in a list format then siply use the below:

du -h
Provides this but it displays all of the sub-folders.
du -h --max-depth=1

Alternative

If --max-depth=1 is a bit too long for your taste, you can also try using:

du -h -s *

This uses -s (--summarize) and will only print the size of the folder itself by default. By passing all elements in the current working directory (*), it produces similar output as --max-depth=1 would:

The difference is subtle. The former approach will display the total size of the current working directory and the total size of all folders that are contained in it… but only up to a depth of 1.

Facebook Comments

More Stuff

How do I check if a port is in use on Linux? I am a new Linux system user. I need to find out which process is listening on a port on Linux using the command line. How do you find out which pro...
How to change the ssh port on Linux or Unix server nixCraft Update... I am a new Linux/Unix server admin. How do I change the SSH Port for my Linux or Unix server using command line option? You can easily change the...
How do I know if my Linux is 32 bit or 64 bit? nixCraft I need to find out if my Linux server is running on 32-bit or 64-bit system. How do I know if my Linux is 32 bit or 64 bit? To check if your Linu...
How to update LXD container Ubuntu image from 16.04 to 18.04 nixCr... I run my app inside Ubuntu Linux 16.04 LTS lxd Linux container. To upgrade Ubuntu 16.04 to 18.04 LTS container, I run do-release-upgrade command, but ...
Spread the love

Posted by News Monkey