Languages
[Edit]
EN

Bash - print files and directories sizes for current working directory

8 points
Created by:
marc_so
1104

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):

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:

 

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join