Sunday, September 22, 2013

How to find big files in linux

find . -size +20000k -exec du -h {} \;


du : Estimate file space usage
sort : Sort lines of text files or given input data
head : Output the first part of files i.e. to display first 10 largest file
Here is what you need to type at shell prompt to find out top 10 largest file/directories is taking up the most space in a /var directory/file system:
# du -a /var | sort -n -r | head -n 10

No comments:

Post a Comment