sajad torkamani
 du -ahd1
  • -a: include files and directories.
  • -h: print sizes in human readable form (e.g., 4M instead of 4000).
  • -d1: restrict contents to those that are one level deep in current path ( i.e. don’t search recursively)

Example output:

28K     ./src
421M    ./node_modules
224K    ./.git
421M    .

Bonus: add shell alias

Add the following to a file your shell will source (e.g., .bashrc or .zshrc).

alias sizes="du -ahd1" 

Tagged: Unix

Leave a comment

Your email address will not be published. Required fields are marked *