cancel
Showing results for 
Search instead for 
Did you mean: 

moving files

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (0)