Every time you encounter a server disk full, will be very distressed, but with the following two ways to easily find the machine in the large files,
The first type: Du-sh
du -sh
The size of the next file or directory in the current directory:
du -sh *
Show the top 10 most space-occupying files or directories:
- Du-s * | Sort-nr | Head
Explanation:-s option specifies that each subdirectory or file is not displayed in detail for the directory size; -H easy-to-read format displays the size of the specified directory or file
Second type: Find command (-size)
A. Find 1K files in/directory, there are three ways:
- Find/-size 2
- Find/-size 1024c
- Find/-size 1K
B. Find files larger than 500M in/directory
Find/-size +500m
Release: The default unit is B, and it represents 512 bytes, so 2 means 1k,1m is 2048, if you do not want to convert, you can use other units, such as C, K, M, G, the inside of the + is greater than equals, the opposite-is less than equal, using the above two methods can easily find the disk of large files, Be sure to use it flexibly.
Linux systems find large file scripts