FSLS - List big files in file system
Jason Zions
jason at hpcnoe.UUCP
Wed Sep 17 01:55:27 AEST 1986
> >>
> >> find / -size +nnn -exec ls -l {} \;
> >
> >You can bury the machine this way!!!! It's incredibly more efficient
> >using xargs(1) instead.
> >
> > find / -size +nnn -print | xargs ls -l
> >
>
> And for those of you who don't have xargs (I thought such creatures
> died after v6!), you can do:
>
> ls -l `find / +nnn -print`
What happend if the find produces more characters than can fit in a command
line? Things don't work so well, the shell moans about "command line too long"
or "too many arguments" or some such mumble. That's why xargs still exists in
System V (well, at least HP-UX, HP's implementation of System V); it uses the
smallest number of command invocations to get them all done.
It's amazing how much faster shell scripts run using xargs (as opposed to
-exec cmd {} \; in a find command); my disk drive doesn't walk across the room
from all the fork/execs...
--
This is not an official statement of Hewlett-Packard Corp., and does not
necessarily reflect the views of HP. It is provided completely without warranty
of any kind. Lawyers take 3d10 damage and roll a saving throw vs. ego attack.
Jason Zions Hewlett-Packard
Colorado Networks Division 3404 E. Harmony Road
Mail Stop 102 Ft. Collins, CO 80525
{ihnp4,seismo,hplabs,gatech}!hpfcdc!hpcnoe!jason or jason at hpcnoe.fc.hp.com
More information about the Comp.sources.bugs
mailing list