30% OFF VPS For The First 12 Months Of Service!

USE COUPON CODE: Q12018

Ends Mar 31, 2018

*T&C Apply

Move a large number of files in Linux

Files in Linux

 

This tutorial will show you how to move a large number of files in Linux

/bin/mv: Argument list too long

When you are trying to move large number of files such 200000 files. you can use the command

mv  /path/to/old-directory /path/to/new-directory

If you try the above command, you will be getting the error “/bin/mv: Argument list too long”

You can use the command given below to avoid this error ,

find /path/to/old-directory -type f | xargs -i mv "{}" /path/to/new-directory