How to Find Large Files Modified Recently in Linux

Quick Linux Tip #80:

Question: My server ran out of disk. Which files grew the most in the last 24 hours?

Try: sudo find / -type f -mtime -1 -size +100M -exec ls -lah {} \; 2>/dev/null

Info: Uses -mtime -1 to target files modified within the last 24 hours and -size +100M to isolate large files. Redirecting errors with 2>/dev/null keeps permission-denied messages out of the results.

Examples:

  • $ sudo find / -type f -mmin -60 -size +50M 2>/dev/null  # Files >50 MB modified in the last 60 minutes
  • $ sudo du -Sh /var/log/* | sort -rh | head  # Find the largest log files and directories
  • $ sudo find /var -type f -size +1G 2>/dev/null | xargs -I {} du -h {}  # Find files larger than 1 GB

Note: The -Sh flags in du separate subdirectory totals to help pinpoint runaway logs quickly, such as systemd journal files, MySQL tables, and Nginx access logs.




LinuxTeck.com
linuxteck:~$ sudo find / -type f -mtime -1 -size +100M -exec ls -lah {} \; 2>/dev/null
-rw-r----- 1 root     adm       1.2G Oct 16 08:23 /var/log/nginx/access.log
-rw-r----- 1 mysql    mysql     2.3G Oct 16 09:45 /var/lib/mysql/production/orders.ibd
-rw-r--r-- 1 root     root      567M Oct 16 10:12 /var/log/journal/abc123/system.journal
-rw-r--r-- 1 www-data www-data  345M Oct 16 10:34 /var/www/uploads/large_video.mp4
-rw-r--r-- 1 linuxteck linuxteck 789M Oct 16 11:23 /home/linuxteck/downloads/dataset.tar.gz
linuxteck:~$

PREVIOUS ARTICLE Quick Linux Tip #79: How to Set 644 for Files and 755 for Directories in Linux
About John Britto

John Britto Founder & Chief-Editor @LinuxTeck. A Computer Geek and Linux Intellectual having more than 20+ years of experience in Linux and Open Source technologies.

View all posts by John Britto →

Leave a Reply

Your email address will not be published.