CentOS7 / RHEL6, how to view the directory and subdirectories size

Original: CentOS7 / RHEL6, how to view the directory and subdirectories size

By powerful [du] command, you can help us quickly view the size of the directory, very practical.

du command to display a directory or file size of disk space occupied. Common combinations of options as: du -sh

[Du] commonly used options:
  -h: display in human-readable way
  -a: displays the disk space occupied by the directory, but also to show its directory and files take up disk space size
  -s: Displays the directory disk space size, do not display the size of its disk space occupied by files and subdirectories


1. CentOS7 / RHEL6, look at the size of a single specified directory

For example: Check the size of your home directory, use the command du -sh / home

2. CentOS7 / RHEL6, look at the size of each subdirectory of a specified directory

For example: the size of each user directory See home directory, using the command du -h --max-depth = 1 / home.

NOTE: CentOS7 parameters may be parameters] [--max-depth parameter d] [replaced complete command du -h -d 1 / home

Guess you like

Origin www.cnblogs.com/lonelyxmas/p/12019865.html