How to Find All Files Larger than XGB in Centos7? Print

  • find files
  • 5

If your server runs multiple applications, it could run out of space anytime. When your server has insufficient disk space, you may be required to identify the larger files on your server occupying the server's space.

Following are some useful commands to locate the large files – 

1. Find the files that are equal to or greater than 500 MB.

find / -type f -size +500M

2. Find files that are greater than X GB.

find / -type f -size +XG 

3. Search files by size and extension.

If you want to find the files with a specific extension, you can run the below-given command to see all the log files that are greater than 1 GB.

find / -type f -name "*.log" -size +XG

Once you know which files are taking up the space, you can take appropriate action to deal with the low space on your server or for any other purpose.


Was this answer helpful?

« Back