Pet*_*r.O 39 command-line gnome-terminal
gnome-terminal 中命令行参数的最大长度是多少?
...并且是否有报告此值的系统环境变量?
Chi*_*aca 33
xargs知道。在我的系统上,
$ xargs --show-limits
Your environment variables take up 2572 bytes
POSIX upper limit on argument length (this system): 2092532
POSIX smallest allowable upper limit on argument length (all systems): 4096
Maximum length of command we could actually use: 2089960
Size of command buffer we are actually using: 131072
Run Code Online (Sandbox Code Playgroud)
Kee*_*ook 18
答案来自sysconf值ARG_MAX。要在您的系统上检查它:
getconf ARG_MAX
Run Code Online (Sandbox Code Playgroud)
对我来说,这个报告2097152。有关更多详细信息,请查看联机帮助页:
man sysconf
Run Code Online (Sandbox Code Playgroud)
要在程序中获取它,例如:
#include <unistd.h>
...
printf("%ld\n", sysconf(_SC_ARG_MAX));
Run Code Online (Sandbox Code Playgroud)