cp/mv/etc : argument list too long ... I am sick of this

Richard Tobin richard at inf.ed.ac.uk
Mon Dec 5 16:23:08 PST 2005


The sysctl kern.argmax reflects the maximum argument list size.  It's
set to 65536, at least in 4.11, and is (I think) not changeable except
by rebuilding the kernel with a different value for ARG_MAX.

> Is well and good that there be some limit to how much data one can pack
> on the command line and incoming arglist in an application's
> environment else fumble fingers could cause major havoc.

This is a bogus argument.  The number of fumbles prevented by a limit
of 65536 is not going to be very different from the number if it was,
say, a million.  On the other hand, having to switch commands once
your data passes some arbitrary size is annoying and (I assert :-) not
in the spirit of BSD.

There may well be some good reasons for limiting the argument size,
especially on a multi-user system.  But the right solution is to make
setting kern.argmax work, and allow system admistrators to decide
what's appropriate for their systems.

(I don't have a more recent release handy to check with; maybe it's
already been done.)

-- Richard


More information about the freebsd-questions mailing list