Using find with -exec to copy large directories

13/10/2009

To copy files from one directory, you might usually do:

cp dir/* anotherdir/

If you try to do this with a particular large number of files, you may encounter the ‘argument list too long’ error. In this case you can use:

find . -exec cp {} /path/to/anotherdir/ \;

More approaches at: http://www.linuxjournal.com/article/6060

No comments yet.

Write a comment: