Argument list too long

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


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:

Leave a Reply

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