Re: Argument List too Long

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Why not just use xargs?

Sent from my iPhone

On May 29, 2010, at 9:42 PM, "Carl T. Miller" <carl@xxxxxxxxxx> wrote:

Sanjay Chakraborty wrote:
I have a script and that run every month, In the script it has a mv
command and that moves about 35000 files from one directory to other
directory. In one system it is working but in other system I am
getting "Argument List too Long" error message.

mv* ../$directory2/ cannot work.

Try this:

ls | while read file; do mv "$file" ../$directory2; done

c


--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list


[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux