brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: find -size +500M -xdev lists big files on one filesystem only

Find
~/tips/tip-find-size-xdev-big-files

sudo find / -xdev -type f -size +500M -exec ls -lh {} +

Lists large files on one filesystem so you can see what is filling it.

When a disk fills up I look for single big files first. -xdev keeps find out of other mounts such as /proc or a network share.

sudo find / -xdev -type f -size +500M -exec ls -lh {} +

-size +500M matches files larger than 500 MiB. find rounds sizes up to whole units, so -size -1M only matches empty files, while -size -1048576c matches everything below 1 MiB. Use the c suffix when you need byte-exact limits. -xdev stays on the filesystem of the starting point. Run it per mount point if you want to cover more than one.

Further reading: find manual page

More Find tips find / -maxdepth 1 -fstype proc find /backup -name '*.gz' ! -exec gzip -t {} \; -print 2>/dev/null find /srv/downloads -type f -size +100M -size -1G -exec ls -lh {} + find /srv/data -depth -print find /srv -xdev -samefile /srv/downloads/movie.mkv All Find tips (46) All topics

Link