Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Limits of length for the expansion of * in Bash? [duplicate]

In Bash

echo *

is almost equivalent to ls.

You can do things like

echo */*-out/*.html > all-my-html-files-on-one-line

Since * is a command line argument then there should be a limit on the length.

What is that limit?

Is the limit different between echo the Bash command and /bin/echo the program?

like image 885
Aleksandr Levchuk Avatar asked Jun 23 '11 22:06

Aleksandr Levchuk


1 Answers

The shell does not limit this

You can see the limit for your system with (run on my 64bit linux:)

$ getconf ARG_MAX
2097152

See this very informational page http://www.in-ulm.de/~mascheck/various/argmax/

like image 98
sehe Avatar answered Sep 21 '22 06:09

sehe