unix

How to identify files that are filling up a file system on your Linux server?

If you notice that a file system on your server is filling up, you can search for files that are consuming the most space.

If for example /var is a separate file system and is filling up, you can run a find command like this:

find /var -xdev -mtime -10 -size +1024k | xargs du -sk | sort -nr -k 1,1 | head -30

The command above will look in /var for files that were modified or created in the last 10 days that are larger than 1 MB, It will then determine the file size with du and sort it displaying the top 30 largest files in descending order.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top