Operating System - HP-UX
1824638 Members
4652 Online
109672 Solutions
New Discussion юеВ

Finding files bigger than 2GB

 
SOLVED
Go to solution
Erik Fredette
Occasional Advisor

Finding files bigger than 2GB

Hi,

I have to copy (cpio) files from one disk array to another, but because of cpio limitation of 2Gb filesize, I have to make sure no files are bigger than 2Gb.

I have been trying many command lines things using ll with grep and print$ but I have not been able to come up with something that will work.

Can someone help me on this one please.

Thanks,
There are always two, no more no less; a Master and an Apprentice.
8 REPLIES 8
H.Merijn Brand (procura
Honored Contributor
Solution

Re: Finding files bigger than 2GB

find . -size +nnnn

where nnnn is the bound you want to check. man find for the gory details
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor

Re: Finding files bigger than 2GB

And, by the way, you should be skipping to GNU cpio, available from ftp://download.xs4all.nl/pub/mirror/gnu/cpio/ which does not have the 2Gb limit
Enjoy, Have FUN! H.Merijn
harry d brown jr
Honored Contributor

Re: Finding files bigger than 2GB

find / -type f -size +2147483648c -exec ls -l {} \;

Of course you could get GNU's tar, which supports 2GB+ files:

http://hpux.cs.utah.edu/hppd/hpux/Gnu/tar-1.13.25/


live free or die
harry
Live Free or Die
Karen Elrod
Frequent Advisor

Re: Finding files bigger than 2GB

You can use find to locate the files that you need.
find / -size +2000000000c

Good Luck,
Karen
A. Clay Stephenson
Acclaimed Contributor

Re: Finding files bigger than 2GB

One very easy technique would be to unmount the filesystem and then attempt to mount it with -o nolargefiles. If that works, you are good to go. You can use find . -size to locate the large files.
If it ain't broke, I can fix that.
MANOJ SRIVASTAVA
Honored Contributor

Re: Finding files bigger than 2GB

Hi Erik


do like this


ls -l | awk '{if ($6 >> "2147483648") print $NF $6}'

this will list the files greater than 2 Gb under the directory where you run this command. Store it in afile and thecheck the filenames etc.

You can use GNU tar to overcome 2.0GB limitation

Manoj Srivastava
S.K. Chan
Honored Contributor

Re: Finding files bigger than 2GB

Just run your "find-cpio" on files which are less that 2GB.. (for exmaple ..)

# find . -type f -size -2000000000c | cpio -pvdumx /

Test first ..

# find . -type f -size -2000000000c -exec ll {} \;
Erik Fredette
Occasional Advisor

Re: Finding files bigger than 2GB

Thanks to you all.

It's working perfectly.
There are always two, no more no less; a Master and an Apprentice.