Linux du and df commands
Some people asked me about the command for viewing the directory size in Linux. Now I want to summarize the two commands du/df I learned a while ago. In the past, the df and du commands were used because the program could
In linux, the du and df commands also asked me about the command for viewing the directory size in Linux. Now I have learned the commands du/df a while ago. A while ago, some sub-Tests encountered that the program could not be executed due to the
Chown commandChown is a command used to set file owners and file associations in Unix systems. Super User Permissions are required to execute this command. OnlyOnly the file owner of a Super User and a group can change the file association group.
du:show Disk usageRole: The size of the disk space occupied by the statistics directory or file.syntax: du parameter optionsParameters:
-A to display disk usage for each file, or to display the respective disk usage for each file in the
The file parameter is actually a directory that reports all the files in that directory. If the file parameter is not provided, the DU command uses the files in the current directory.If the file parameter is a directory, then the number of reported
Du simple Usage exampleDu-SH xmldb/Du-Sm* | sort -n //statistics current directory size and size sorting du -sk *| sort -ndu -sk * | grep guojf //look at a person's size du -m | cut -d "/" -f 2 //See text before second/character See how
For example, check the size of the home directory:
Du-s/home
You can also:
Du-sh/home
/usr/local/apache/bin/htcacheclean-v-p/cacheroot-l500m
Statistics:
Size Limit 500.0M
Total size is 91.8M, total size now 91.8M
Total entries is 3754, total
In linux, the du and df commands also asked me about the command for viewing the directory size in Linux. now I have learned the commands du/df a while ago. A while ago, during the sub-test, the program could not be executed due to the full disk
du [-ABCDHHKLMSSX] [-l ][-x ][--block-size][--exclude=][--help][--version][directory or file]Common parameters:-A or-all displays disk usage for each specified file, or displays the respective disk usage for each file in the directory.-B or-bytes
The file parameter is actually a directory that reports all the files in that directory. If the file parameter is not provided, the DU command uses the files in the current directory.If the file parameter is a directory, then the number of reported
1. Df-lh
2. Du-s/usr/* | Sort-rn
This is sorted by byte
3. du-sh/usr/* | Sort-rn
This is sorted by megabytes (M)
4. Select 10 of the preceding
Du-s/usr/* | Sort-rn | Head
5. Select the following 10
Du-s/usr/* | Sort-rn | Tail
Du-h–-max-depth=0
1. Df-lh
2. Du-s/usr/* | Sort-rn
This is sorted by byte
3. du-sh/usr/* | Sort-rn
This is sorted by megabytes (M)
4. Select 10 of the preceding
Du-s/usr/* | Sort-rn | Head
5. Select the following 10
Du-s/usr/* | Sort-rn | Tail
du [-ABCDHHKLMSSX] [-l ][-x ][--block-size][--exclude=][--help][--version][directory or file]Common parameters:- A or-all displays disk usage for each specified file, or displays the respective disk usage for each file in the directory. - B or-bytes
DF -H/du -hs./dugrep [[:d igit:]+]gdu [-ABCDHHKLMSSX] [-l ][-x ][--block-size][--exclude=][--help][--version][directory or file]Common parameters:-A or-all displays disk usage for each specified file, or displays the respective disk usage for each
1. Df-lh
2. Du-s/usr/* | Sort-rn
This is sorted by byte
3. du-sh/usr/* | Sort-rn
This is sorted by megabytes (M)
4. Select 10 of the preceding
Du-s/usr/* | Sort-rn | Head
5. Select the following 10
Du-s/usr/* | Sort-rn | TailDu-h–-max-depth=0
First with du-sh/usr/* | Sort-rn This command to view the USR directory
Found this directory is very large and then go to see which directory is big
Finally found cd/usr/local/mysql/data this directory to the largest and then use Du-h–max-depth=1
Remove command rm under SSH
Start to find online explanation RM [path] can delete files/foldersBut when I used to delete, I was prompted:
RM admin1Rm:cannot remove ' admin1 ': is a directory
Later found RmDir, but only the empty folder can be
Original
Detailed DF command usage
A: displays the disk usage of all file systems and partitions.
I: displays the I-nodes usage.
K: The size is represented by K (default)
T: displays the disk usage of all partitions in a file
How to view server information in centos LinuxSome customers often ask Cloud Zhi interconnection to view some hardware configuration methods of the server. The following uses centos as an example to share various information viewing methods with
--- Http://www.ibm.com/developerworks/cn/linux/l-dynlink/index.html
To run a program in the memory, in addition to compiling, the link and loading steps are required. From the programmer's point of view, the advantage of introducing these two steps
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.