How do move large number of files ?

Loïc Grenié loic.grenie at gmail.com
Wed Apr 14 12:25:49 UTC 2010


2010/4/13 MirJafar Ali <mirjafarali at gmail.com>:
> 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

    (It is not so much a mv problem but a bash problem, but it does not
  really matter)

   Are there any subdirectories in your directory DataSet ? If not, the
  standard way is:

find -name file\* -exec mv \{\} SFiles \;

  it is not very fast, but should get the job done.

   If there are subdirectories, a -prune option might be necessary for
  find (but I've not looked how to use it, just tell me if you need it).

     Hope this helps, feel free to ask if you have subdirectories,

        Loïc




More information about the ubuntu-users mailing list