Command Line Maximum

Kevin Morris kevjmorris-PkbjNfxxIARBDgjK7y7TUQ at public.gmane.org
Wed May 14 18:12:47 UTC 2008


thanks! it worked.

> Date: Wed, 14 May 2008 09:47:32 -0400
> To: tlug-lxSQFCZeNF4 at public.gmane.org
> Subject: Re: [TLUG]: Command Line Maximum
> From: lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
> 
> On Wed, May 14, 2008 at 09:25:27AM -0400, Kevin Morris wrote:
> > I have a script that uses mv to move a set of files. Whenever there are a very large number of files it fails, the reason: command line limit of a shell. I think xargs will resolve this problem, my question is how do I find this limit and any pointers on how to use xargs with the mv command in a bash script.
> 
> Different shells have different limits, and the OS you are running the
> shell on also affects the limit.  I think most systems allow 32k
> characters, some more, some less.  In general if you aren't sure how
> many files you are about to deal with, use xargs to batch them.  To make
> spaces in filenames safe, use -print0 with find and -0 with xargs.  And
> always remember the 'don't run if no arguments' option to xargs as well.
> 
> -- 
> Len Sorensen
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists

_________________________________________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/legacy/attachments/20080514/98c02d86/attachment.html>


More information about the Legacy mailing list