Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How much data can be passed as command line arguments?

How many bytes can be sent as command-line argument when spawning a process under Linux?

like image 335
jldupont Avatar asked Sep 26 '09 00:09

jldupont


1 Answers

gahooa suggests a good article at http://www.in-ulm.de/~mascheck/various/argmax/, but if that page disappears someday, here's the meat of the matter: to find the max length of your command line arguments try one of the following

* command: getconf ARG_MAX
* system call: sysconf(_SC_ARG_MAX)
* system header: ARG_MAX in e.g. <[sys/]limits.h>
like image 197
Shannon Nelson Avatar answered Sep 30 '22 08:09

Shannon Nelson