How do move large number of files ?
Fred Roller
fred at fwrgallery.com
Wed Apr 14 11:11:05 UTC 2010
On 04/13/2010 03:09 PM, MirJafar Ali wrote:
> Hello,
>
> I have very huge number of files in one directory that I wish to move
> to some other folder and
> the standard "mv" just screames
>
> crash-06:~/DataSet$ mv file* SFiles
> bash: /bin/mv: Argument list too long
>
>
> Can someone suggest what is may be a good solution. of course picking
> one by one is ruled out.
>
> Mir
>
>
>
You can try:
cd [directoryof source]
for i in *; do mv $i [fullpathtodestination]/; done
or safer option is (provided you have the disk space)
cd [directoryof source]
for i in *; do cp -a $i [fullpathtodestination]/; done
# once done and confirmed do: (you can use a wildcard just be /very/
careful.)
rm [pathtosource]/[files]
in either case the for statement will execute one file at a time so as
not to over load the mv command. Any one of the these and the other
suggestions will work for you. Just pick the one you are most
comfortable with using. Hope these help.
--
Fred
www.fwrgallery.com
"Life is like linux, simple. If you are fighting it you are doing something wrong."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20100414/3a097760/attachment.html>
More information about the ubuntu-users
mailing list