View current directory Size:
The code is as follows |
Copy Code |
[root@512m50g/]# Du-sh
|
To view the specified directory size:
The code is as follows |
Copy Code |
[root@512m50g/] #du-sh/var/www.111cn.net/blog
|
To view the total number of current directory files:
The code is as follows |
Copy Code |
[root@512m50g/] #find. -type F |wc-l
|
To view the total number of specified directory files:
The code is as follows |
Copy Code |
[root@512m50g/] #find/var/www.111cn.net/blog-type f |wc-l
|
To view the total number of directories in the current directory:
The code is as follows |
Copy Code |
[root@512m50g/]# Find. -type D |wc-l
|
To view the total number of directories in the specified directory:
The code is as follows |
Copy Code |
[root@512m50g/]# find/var/www.111cn.net/blog-type D |wc-l
|
Du-sh file or directory name
Usage: du [options] ... [File] ...
Summarize the amount of disk used in each < file >, and take the total amount of the catalogue.
Parameters that must be used with long options are also required when using short options.
-A,--all write counts for all files, not just directories
-B,--block-size=size use size-byte blocks
-B,--bytes print size in bytes
-C,--total produce a grand total
-D,--dereference-args dereference FILEs that are symbolic links
-H,--human-readable the file size in an Easy-to-understand format (e.g. 1K 234M 2G)
-H,--si is similar to-H, but takes 1000 of the second party instead of 1024
-K is--block-size=1k
-L,--count-links the size of a hard link is also counted
-L,--dereference find the true destination of any symbolic link indication
-S,--separate-dirs does not include the amount of subdirectories
-S,--summarize only calculates the total amount of each parameter in the command column, respectively
-X,--one-file-system skip directories on different filesystems
-X FILE,--exclude-from=file exclude files, match any, and in FILE.
--exclude=pattern exclude files that match pattern.
--max-depth=n Print to a directory (or file, with--all)
Only if it is N or fewer levels below the command
line argument; --max-depth=0 is the same as
--summarize