In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the "Linux file size command du command is what", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "Linux file size command du command is what" it!
The Linux View File size du command displays the number of blocks used for the file. If the specified File parameter is actually a directory, all files in that directory are reported. If no File parameter is provided, the du command uses the files in the current directory.
If the File parameter is a directory, the number of blocks reported is the sum of the blocks allocated to the files in the directory and to the directory itself.
Linux View File size Syntax
Du [- a |-s] [- k] [- m] [- g] [- l] [- r] [- x] [- H |-L] [File.]
Specify the-a flag to report the number of blocks in the individual file. Individual files specified by the File parameter are always listed, regardless of whether or not the-a flag is used.
Specify the-s flag to report all blocks used for all specified files and all files in the directory.
The block count includes indirect blocks for each file. The block count is calculated in 512-byte units, regardless of the cluster size used by the system. Specify the-k flag to calculate the number of blocks in 1024 byte units.
Note:
Files with multiple links count and write for only one item.
Because the block count is based only on file size, unallocated blocks are not included in the number of blocks reported.
If du does not get the file attributes or cannot read the directory, it reports an error and affects the exit status of the command. Linux View File size Flag
"- a displays disk usage for each specified file, or for each file in the directory." Compare this logo with the-s flag.
-g calculates the number of blocks in GB units instead of the default 512-byte units. The output value for disk usage should be a floating-point number, because the value can be very large in bytes.
-H if a symbolic link is specified on the command line, the du command counts the size of the file or file hierarchy referenced by the link.
-k calculates the number of blocks in 1024 byte units instead of the default 512 byte units.
-l distribute blocks evenly between file links and multiple links. According to the default, files with two or more links are counted only once.
-L if symbolic links are specified on the command line or encountered multiple times during traversal of the file hierarchy, the du command should count the size of the file or file hierarchy referenced by the link.
-m calculates the number of blocks in MB units instead of the default 512-byte units. The output value for disk usage should be a floating-point number, because the value can be very large in bytes.
-r reports inaccessible file or directory names. This is the default setting.
-s displays the entire disk usage for all specified files, or the total disk usage for all files in a directory. Compare the logo with the-a flag.
-x when evaluating file size, only those files that reside on the same device as those specified by the File parameter are evaluated. For example, you can specify a directory that contains files on multiple devices. In this case,
The-x flag shows the block size for all files that reside on the same device as the directory.
If all the-k,-m, and-g flags are specified, or any two of them, the one specified by * works. Output disk usage with the flags-m and-g will approximate to the nearest second decimal number.
Exit statu
The Linux View File size command returns the following exit values:
0 ended successfully.
Thank you for your reading, the above is the "Linux file size command du command is what" the content, after the study of this article, I believe you on the Linux file size command du command is what this problem has a deeper understanding, the specific use of the need for you to practice verification. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.