Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

moving files

Hi experts,

I am trying to move files from one directory to another directory, there are nearly 5lakh of files to be moved from one dir to another dir.

I am doing as follows

host:> cd /directory1

host :> mv 2008* /directory2

i am getting the followin error Arguments : to many arguments.

If i move 20 to 40 files i don't get the error. Can someone help me if there is any command to move the files.

thanks

pl help.

replied

Hi

The problem is your command line gets too large (because of too many files). You can use a find command, which will move the files one by one.

host> cd /directory1
host> find . -name "2008*" -exec mv {} /directory2 \;

Looks a bit weird but should work nicely.

Regards

Michael

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question