EN
Bash - print files and directories sizes for current working directory
8 points
In this short article, we would like to show how to print sizes for files and directories located in the current working directory using Bash.
Quick solution (run the following command):
xxxxxxxxxx
1
du -hs *
Where:
-h
causes printing in human-readable format (KB, MB, GB, etc.),-s
causes printing total size summary for each element in the directory,*
causes checking size for each not hidden item in the current working directory.
Example output:
xxxxxxxxxx
1
3.3G pictures
2
9.0G backups
3
135M projects