Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to locate large files (> 100 MB) in /home/ for 'cleaning'?

It's Centos 6.x. I tried some commands, but they didn't work.

share|improve this question
So which commands did you try? – Decado Sep 16 '12 at 8:39
up vote 33 down vote accepted

Find has it's own -delete option so

find /home -type f -size +100M -delete

should do what you want. Just be careful about where you put the -delete option

Warnings: Don’t forget that the find command line is evaluated as an expression, so putting -delete first will make find try to delete everything below the starting points you specified.

If you want to test this before using it then you need to add -depth as -delete implies it.

find /home -type f -size +100M -depth
share|improve this answer
For future visitors who may not be on CentOS: Both the modern GNU and BSD variants of find (1) (including that of OS X) support the -delete flag, but it is not part of the standard. If you should need an alternative, use -depth -exec rm {} +. – kojiro Sep 16 '12 at 23:04
Good to know! I was not aware the -delete flag could be used to locate large files... It seems I don't have any... Strange ;) ;) ;) – user130370 Sep 18 '12 at 0:30
@EricDANNIELOU: Your point being ? – Iain Sep 18 '12 at 6:11

ncdu is a nice interactive tool to find big files or directories. It will scan a given directory and show a simple ncurses interface to present sizes of directories. It also has a shortcut to delete a file/directory.

share|improve this answer
find, du and awk have an advantage of being standard – nponeccop Sep 16 '12 at 21:21
And ncdu has the advantage of being interactive. – liori Sep 16 '12 at 21:23
I've used ncdu for disk cleanup too! It's just great! – Meysam Sep 17 '12 at 7:00

Just find: find /home -type f -size +100M

find and remove find /home -type f -size +100M -print0 |xargs -0 rm

share|improve this answer
du /home | awk '$1 > 1234 { print }'

It searches not for large files but for large folders. In case of running out of file space I try to look both for large files and large folders to identify problematic areas.

share|improve this answer
du -a will have it print both individual files and folders' totals. Also, on many file systems, you need to add -k to make it print the size in KiB instead of arbitrary block-size counts, so I always include -k as a force of habit. – fluffy Sep 16 '12 at 16:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.