How to find large file size on linux (Solution)
Recently my fedora core run out of space, i start to think whether linux provide any command to check large file size on file system? luckily i found below command.
find / -type f -size +100000k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'if you encounter some permission denied error, please issue sudo prefix and make sure you have sudo privileges
sudo find / -type f -size +100000k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'Above command will find all files which file size exceed 100mb on any directories.
P.S you can customized above command to whatever you like
find (directory path) f -size (file size) -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'
Ops, just now I noticed, the “sort” part won’t work quite right though. 1.000 GB files will appear at the top, followed by 100 MB files, going down until you reach 900MB file sizes. It still helps, as long as you have that in mind.
Thanks. Specially useful if you’re browsing a cifs mount, on which graphic file size visualizers like that konqueror plugin (I guess) don’t work.
Just one suggestion, I think it goes better with the awk part as:
awk ‘{ print $5 “: ” $8 }’ | sort
with the file size first, followed by the file name (which in my case would be number 9, not 8 BTW), and then followed by “sort”, so you have it ordered by file size, which may be useful in helping to deal with the largest files first.
Thanks for your invaluable inputs.
[...] [...]
[...] comando [...]
[...] comando [...]
[...] [...]