ONE NET WIKI Free and professional IT Wiki

How to check the size of a directory in Linux

2018-08-30 ONE NET WIKI


"du" stands for "Disk Usage".

"du" command is used to display the amount of disk space used by the specified files and for each subdirectory.

du [OPTION]... [FILE] [directory]...
du [OPTION]... --files0-from=F

1. See a brief help message

du --help


2. Display the size in human readable format

du -h /path/do/dir

3. Use -k for kilobytes, -m for megabytes

du -k /path/do/dir
du -m /path/do/dir

4. Display the disk usage of all items including files and directories

// use -a option 
du -ah /path/do/dir

5. Check the total disk space used by a particular directory

// -s means summary
du -sh /path/do/dir

6. Display the grand total of directories

// -c option
du -csh /path/do/dir

7. Display the size of multiple directories at once

du -h directory1 directory2


Editor's Note: All the articles in this website are original. If reproduced, please indicate the source and link.
All Comments (0)
Expand to publish a comment

Web Development

Web Management

Web Marketing

Web Security