Argument list too long

Occasionally you’ll get this message when trying to move or copy a large number of files on your server.

E.g. 

mv * ../directory2

bash: /bin/mv: Argument list too long

Here’s one way of solving it:

[user@localhost directory]$ find $directory -type f -name ‘*’ -exec mv

{} $directory2/ \;

See also:

http://www.linuxjournal.com/article/6060

Leave a Reply

Your email address will not be published. Required fields are marked *