[TriLUG] How many character are allowed on the command line?

William Sutton william at trilug.org
Mon May 29 14:40:23 EDT 2006


Well, if you've ever done something like 

echo `find . -type f` >files.txt

(that's an example...... :) ; wildcarding can also do it since the UNIX 
shells expand your wildcards before executing.....)

you'd find out pretty quickly that the output from the executed backticked 
command counts as part of the command line arguments for the second 
command....get enough, say, files, and pretty soon you've blown the shell 
command size limit out of the water.  As a previous individual commented, 
this is why xargs is so popular.

Now then....my recollection is that the max length is dependant on the 
particular OS (and maybe architecture?)...

-- 
William Sutton

On Mon, 29 May 2006, Shane O'Donnell wrote:

> I'm curious as to what sort of task merits a bash "one-liner" versus jumping
> out and writing a legit "script".
> 
> For my money, just for simple editing reasons, two lines would be my
> breaking point before my one-liner made the jump to "script worthy".
> 
> Curious,
> 
> Shane O.
> 
> On 5/29/06, Russell Harrison <rtlm10 at gmail.com> wrote:
> >
> > I know I've done bash one liners that wrapped at least a full screen of
> > text.  There had to be a good 1000 chars in that one "line".
> >
> > On 5/29/06, Ralph Blach <rcblach at blach.dnsalias.org> wrote:
> > >
> > > I am taking a class in computer science and the professor seems to
> > > indicate the the maximum number of character one can enter from the
> > > command line is 256 in both Windows command prompt  and the "IX's"
> > > command prompt.
> > >
> > > From long ago, I seem to remember that this was  256 characters was a
> > > limitation of the DOS command prompt in Windows at one time,
> > > but never in  the "IX's" such as AIX, Linux, Solaris, .... .
> > >
> > > Could the knowledgeable Trilug community comment on this?
> > >
> > > Thanks
> > >
> > > Chip
> > >
> > > --
> > > TriLUG mailing list        :
> > http://www.trilug.org/mailman/listinfo/trilug
> > > TriLUG Organizational FAQ  : http://trilug.org/faq/
> > > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> > >
> > --
> > TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> > TriLUG Organizational FAQ  : http://trilug.org/faq/
> > TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> >
> 
> 
> 
> 



More information about the TriLUG mailing list