DU Commands Cheat Sheet

Here is a cli commands cheat sheet for DU command, you can use this as a quick reminder for basic commands with a brief description for each of the commands.

What is DU command?

Add some data here

        # To sort directories/files by size:
du -sk *| sort -rn

# To show cumulative human-readable size:
du -sh

# To show cumulative human-readable size and dereference symlinks:
du -shL

# Show apparent size instead of disk usage (so sparse files will show greater
# than zero):
du -h --apparent-size

# To sort directories/files by size (human-readable):
du -sh * | sort -rh 

# To list the 20 largest files and folders under the current working directory:
du -ma | sort -nr | head -n 20
    

Check out the DU command documentation .


You can also check our MegaSh cheatsheet tool, that has 150+ searchable linux cheat sheets in one page, so you never forget a command as you work again

Check Also

Best AI tools list