Operating System - HP-UX
1752772 Members
5179 Online
108789 Solutions
New Discussion юеВ

Re: How to check files with more then 1MB in a filesystem

 
GSB_3
Frequent Advisor

How to check files with more then 1MB in a filesystem

How to check files with more then 1MB in a filesystem.

Thanks in advance
6 REPLIES 6
Redhat
Trusted Contributor

Re: How to check files with more then 1MB in a filesystem

you can use something like this:-
find / -type f -size +100000 -exec ll {} \;
Dennis Handly
Acclaimed Contributor

Re: How to check files with more then 1MB in a filesystem

$ find /path -xdev -size +1000000c
G V R Shankar
Valued Contributor

Re: How to check files with more then 1MB in a filesystem

find /path -size +1000000c -xdev -exec ls -ld {} \;

I have used ls -ld, instead of ll, because if the directory file is above 1 MB, it will list all the file iunder the directory, to avoid confusion it is better to use ls -ld.

Cheers,
Ravi.
Yogeeraj_1
Honored Contributor

Re: How to check files with more then 1MB in a filesystem

hi,

You may also wish to sort them so that the largest file comes first:

find . -size +1000000c -xdev -exec ls -ld {} \; |sort +4 -5nr


hope this helps too!
kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Samir Pujara_1
Frequent Advisor

Re: How to check files with more then 1MB in a filesystem

find -xdev -type f -size +1024 -exec ls -l {} \;| awk '{print $9, $5}'|sort -rn +1|awk '{print $1, $2/1024/1024 "MB"}' |more


Note: this will give you list of all files bigger than 1 MB in sorted order with Bigest file first. Listing will be showing filename and size in MB.

cheers...
Dennis Handly
Acclaimed Contributor

Re: How to check files with more then 1MB in a filesystem

>Samir: ... -size +1024

These are not the droids (option) you want. ;-)

What you have is > 1024 blocks. And blocks is the useless value 512. :-(

That's why most answers used +1000000c.