Tips for finding large files or directories under a Linux system
The command line is as follows
Find. -type f-size +1000000k
Tips for finding large files or directories under a Linux system
When the hard disk space is not enough, we are very concerned about which directories or files are relatively large, to see if we can kill some, how to know?
#已易读的格式显示指定目录或文件的大小,-s option specifies that each subdirectory or file size is not displayed in detail for the directory
Du-sh [Dirname|filename]
Such as:
Size of current directory:
Du-sh.
The size of the next file or directory in the current directory:
Du-sh *
[Email protected] var]# Du-sh *
12K Account
1.7M Cache
16K crash
28K DB
28K Empty
16K FTP
12K GDM
3.7G Lib
8.0K Local
36K Lock
13M Log
16K Lost+found
4.0K Mail
8.0K NET-SNMP
8.0K NIS
8.0K opt
8.0K Preserve
240K Run
14M Spool
12K tmp
8.0K Tux
2.1M www
24K YP
Show the top 10 most space-occupying files or directories:
Du-s * | Sort-nr | Head
Use root to/directory to take advantage of commands
Du-s-H/*
To see which directory occupies so many disks, if found, go to that directory, and use the same method to locate the file.
Tips for finding large files or directories under a Linux system