Wednesday, 28 December 2016

How to Find Directory or File Size - Disk Usage

1) Disk Usage(DU) command can be used to know sizes of directories,sub-directories and files.
2) This command works in recursive manner.

Default usage: du -h directory.
   i)   Here h option is for displaying sizes in human readable format.
   ii)  Last line displays, total size of directory.
   iii) This command only considers sub directories by default.


3) Option -a can be used to include files in the directory.
   
 
4) Option -s can be used to know size of directory.

    'S' stands for summary

5) --time can be used for sorting based on modification date.
6) --exclude="*.xml" can be used for excluding specific type of files while computing size of directory.

Happy Learning 😊

No comments:

Post a Comment