List size of files and directories
11 March 2022 (Updated 11 March 2022)
du -ahd1
-a: include files and directories.-h: print sizes in human readable form (e.g.,4Minstead of4000).-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
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment