Run the "du-habc.tar" command to view the entire folder size in the centoscn directory under the "abc.tarfile" directory. run the "du-shcentoscnps: syntax: du [-abcDhHklmsSx] [-L & lt; symbolic connection & gt; file & gt;] [-- block-size] [-- exclude = & lt; directory or file & g
Run the "du-h abc.tar" command to resize the abc.tar file in the current directory.
Run the "du-sh centoscn" command to view the entire folder size in the centoscn directory.
Ps: syntax: du [-abcDhHklmsSx] [-L <符号连接> ] [-X <文件> ] [-- Block-size] [-- exclude = <目录或文件> ] [-- Max-depth = <目录层数> ] [-- Help] [-- version] [Directory or file] common parameters:-a or-all shows the disk usage for each specified file, you can also view the disk usage of each file in the directory. -B or-bytes: displays the size of directories or files in bytes. -C or-total not only displays the directory or file size, but also the total number of all directories or files. -D or-dereference-args displays the size of the source file connected by the specified symbol. The unit of-h or-human-readable is K, M, and G, which improves information readability. The-H or-si parameters are the same as the-h parameters, but K, M, and G are in units of 1000, rather than 1024. -K or-kilobytes is in the unit of 1024 bytes. -L or-count-links repeat the hardware connection file. -L <符号连接> Or-dereference <符号连接> Displays the size of the source file connected by the specified symbol in the options. -M or-megabytes is in the unit of 1 MB. -S or-summarize only displays the total, that is, the size of the current directory. -S or-separate-dirs displays the size of each directory in hours without the size of its subdirectories. -X or-one-file-xystem is based on the file system at the beginning of processing. if it encounters a different file system directory, it is skipped. -X <文件> Or-exclude-from = <文件> In <文件> Specifies a directory or file. -Exclude = <目录或文件> Skips the specified directory or file. -Max-depth = <目录层数> If the number of directories exceeds the specified number of layers, ignore them. -Help: displays help. -Version: displays the version information. Example of using the du command in linux: 1> to display the disk usage of a directory tree and each subtree du/home/linux, the number of disk blocks is displayed in the/home/linux directory and each subdirectory. 2> to display the disk usage of a directory tree and its sub-trees in 1024 bytes, du-k/home/linux is displayed in the/home/linux directory and each of its sub-directories. the disk size is 1024 bytes. 3> the disk usage of a directory tree and its sub-trees is displayed in MB. du-m/home/linux shows the MB disk in the/home/linux directory and each sub-directory. number of blocks. 4> Display the disk usage of a directory tree and its sub-trees in GB. du-g/home/linux shows the GB disk in the/home/linux directory and its sub-directories. number of blocks. 5> view the size of all directories and subdirectories in the current directory: du-h. "." indicates the current directory. You can also use a clear path-h to display the user directory in the form of K, M, and G. 6> view the size of the user directory in the current directory, rather than viewing other directories and their subdirectories: du-sh user-s indicates the meaning of the summary, that is, to list only one summary value du-h-max-depth = 0 user-max-depth = n indicates that only the directory at the nth layer is penetrated. here, the value is set to 0, that is, the sub-directory is not penetrated. 7> list the sizes of all directories and files in the user directory and its subdirectories: du-ah user-a indicates that the directory name in the current directory does not include the directory size of the xyz string, including the directory and file 8>: du-h-exclude = '* xyz *' 9> to list more information about the user directory and subdirectory size on one screen: du-0 h user-0 (zero bars) indicates that the information of each directory is listed. instead of line feed, the information of the Next Directory is directly output. 10> only display all disk usage of one directory tree du-s/home/linux