1.Linux find large files or directories 1.1 files that exceed a specified size in the specified directory, only show path + file name
find ./-type f-size +20M. /elasticsearch-6.2. 4 . rpm. /shakespeare_6. 0. JSON
1.2 Search for files that exceed a specified size in the specified directory (file size only, filename)
Method 1
Find Xargs ls awk ' {print $5,$9} ' 28M. /elasticsearch-6.2. 4 . rpm25m. /shakespeare_6. 0. JSON
Method 2
Find Xargs du -h28m . /elasticsearch-6.2. 4 . rpm25m . /shakespeare_6. 0. JSON
1.3 Search for files larger than the specified size in the specified directory (size sort)
Find Xargs ls awk ' {print $5,$9} ' sort -nr28m. /elasticsearch-6.2. 4 . rpm25m. /shakespeare_6. 0. JSON
1.4 Find a large directory under Linux
Generally df-h can only view the usage of disk partitions, which is obviously more appropriate for the directory size du command
Find a large directory under a specified directory
du -h/usr/--max-depth=1/usr//usr/sbin529m /usr/lib159m /usr/lib641. 1G /usr/share0 /usr/etc 0 /usr//usr//usr/libexec0 /usr/local0 /usr/src1. 9G /usr/
Tips:
--max-depth=2 the deepest of the specified file is equivalent to-D2
-M like--block-size=1m
Show directory size from large to lower, and exclude empty directories
du -hm/usr/-d1| Sort grep " ^[^0] " 1927 /usr/1101 /usr/share529 /usr/Lib159 /usr/lib64 /usr/bin /usr/sbin /usr/ libexec 1 /usr/include
Linux finds large files or directories