megacolorboy

Back

Published on April 10th, 2021

Unix

Get a list of directories with their sizes in the current directory

If you want to sizes of each directory in a list, try the following command:And, if you wanted to find the directory that takes consumes a lot of space in your directory, you can try this:Hope these tips do come in handy! 😊

1 minute read

If you want to sizes of each directory in a list, try the following command:


du -sh * | sort -h >> directories-sorted.txt

And, if you wanted to find the directory that takes consumes a lot of space in your directory, you can try this:


du -sh * | sort -h | tail -n 1

Hope these tips do come in handy! 😊