[CentOS] -bash: /bin/mv: Argument list too long

Thu Jun 15 15:03:03 UTC 2006
Charles Lacroix <clacroix at cegep-ste-foy.qc.ca>

On Thursday 15 June 2006 10:56, William L. Maltby wrote:
> On Thu, 2006-06-15 at 22:41 +0800, Mark Quitoriano wrote:
> > what's a workaround for this?
> >
> > -bash: /bin/mv: Argument list too long
>
> Almost forgot. Instead of find, if the names can be echoed into a file,
> then
>
>     cpio -pdumav </your/target/directory> </the_input_file
>
> > <snip>

or if you do it with a file .. 
ls dir > file.txt

perl -pi -e 's/^/mv /' file.txt
perl -pi -e 's/$/\/new\/path\/for\/files/' file.txt

chmod a+x file.txt
./file.txt

...