[OT] Argument list too long

Eldridge, Michael michael.eldridge at evolveddigital.com
Fri Aug 12 17:05:10 UTC 2005


> Am Freitag, 12. August 2005 18:18 schrieb Thomas Kaiser (ubuntu):
> > thomas at AMD64:~$ cp -r /media/nethd/Sound/* /media/Sound/
> > bash: /bin/cp: Argument list too long
> 
> Untested(!):
> $ find /media/nethd/Sound -type f --maxdepth 1 -print0 | xargs -0 cp 
> --target-directory=/media/Sound

this will not solve the problem, as xargs is used for building
command lines.  all you've done is moved the overhead of creating
the command line from the shell globbing to a separate binary.
you solve nothing by using this and create additional overhead
in the process.

not only that, but you leave any subdirectories behind.  see my
other responses for how to correctly utilize find and xargs.

-mike




More information about the ubuntu-users mailing list