它传递的参数的最大大小

它传递的参数的最大大小

本文介绍了linux命令xargs:它传递的参数的最大大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎xargs没有一次通过所有的参数,在手册中说xargs 执行命令(默认是/ bin / echo)一次或多次,我听说这样做的原因是,xargs将传入的参数剁成组并将它们按组传递给命令组。如果这是正确的,任何人都知道如何确定这个组大小?感谢

It seems that xargs doesn't pass all the arguments at once, in says in the manual that xargs executes the command (default is /bin/echo) one or more times, I heard that the reason for this is that xargs chops the passed in arguments into groups and pass them to the command group by group. If this is correct, anyone knows how this group size is determined? Thanks

推荐答案

使用 - show-limits 参数。它将列出您系统上的现有限制。

Use the --show-limits argument. It will list the existing limits on your system.

$ xargs --show-limits
Your environment variables take up 4108 bytes
POSIX upper limit on argument length (this system): 2090996
POSIX smallest allowable upper limit on argument length (all systems): 4096
Maximum length of command we could actually use: 2086888
Size of command buffer we are actually using: 131072

组大小取决于长度

xargs 手册页,供参考:

这篇关于linux命令xargs:它传递的参数的最大大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 18:44