Powered by Blogger.

SIZE OF A DIRECTORY – COMMAND LINE


du -sh is a good place to start. The options are (from man du):
   -s, --summarize
          display only a total for each argument

   -h, --human-readable
          print sizes in human readable format (e.g., 1K 234M 2G)
To check more than one directory and see the total, use du -sch:
   -c, --total
          produce a grand total


To get the size of all the directories, files
du -sh *
will give you the size of all the directories, files, etc in current directory in a human-readable format.
You can use the df the command to know the free space in the disk:
df -h 

No comments