zoukankan      html  css  js  c++  java
  • Limiting Command Size

    Next: Controlling Parallelism, Previous: Unusual Characters in File Names, Up: Multiple Files [Contents][Index]

    3.3.2.4 Limiting Command Size
    xargs gives you control over how many arguments it passes to the command each time it executes it. By default, it uses up to ARG_MAX - 2k, or 128k, whichever is smaller, characters per command. It uses as many lines and arguments as fit within that limit. The following options modify those values.

    --no-run-if-empty
    -r
    If the standard input does not contain any nonblanks, do not run the command. By default, the command is run once even if there is no input. This option is a GNU extension.
    https://www.gnu.org/software/findutils/manual/html_node/find_html/Limiting-Command-Size.html#:~:text=xargs gives you control over,as fit within that limit.

    --max-lines[=max-lines]
    -L max-lines
    -l[max-lines]
    Use at most max-lines nonblank input lines per command line; max-lines defaults to 1 if omitted; omitting the argument is not allowed in the case of the ‘-L’ option. Trailing blanks cause an input line to be logically continued on the next input line, for the purpose of counting the lines. Implies ‘-x’. The preferred name for this option is ‘-L’ as this is specified by POSIX.

    --max-args=max-args
    -n max-args
    Use at most max-args arguments per command line. Fewer than max-args arguments will be used if the size (see the ‘-s’ option) is exceeded, unless the ‘-x’ option is given, in which case xargs will exit.

    --max-chars=max-chars
    -s max-chars
    Use at most max-chars characters per command line, including the command initial arguments and the terminating nulls at the ends of the argument strings. If you specify a value for this option which is too large or small, a warning message is printed and the appropriate upper or lower limit is used instead. You can use ‘--show-limits’ option to understand the command-line limits applying to xargs and how this is affected by any other options. The POSIX limits shown when you do this have already been adjusted to take into account the size of your environment variables.

    The largest allowed value is system-dependent, and is calculated as the argument length limit for exec, less the size of your environment, less 2048 bytes of headroom. If this value is more than 128KiB, 128Kib is used as the default value; otherwise, the default value is the maximum.

    Next: Controlling Parallelism, Previous: Unusual Characters in File Names, Up: Multiple Files [Contents][Index]

  • 相关阅读:
    爬虫(一)—— 爬取一个简单的网站
    Neutron的安全组原理
    Neutron的防火墙原理
    Openstack Mitaka 负载均衡 LoadBalancerv2
    iptables(四)iptables匹配条件总结之一
    iptables(三)iptables规则管理(增、删、改)
    iptables(二)iptables实际操作之规则查询
    iptables(一)iptables概念
    opensack-mitaka网络性能测试shaker
    neutron二层网络实现
  • 原文地址:https://www.cnblogs.com/chenjo/p/14296476.html
Copyright © 2011-2022 走看看