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]

Limiting Command Size的更多相关文章

  1. [Mongo] error inserting documents: BSONObj size is invalid (mongoimport mongorestore 数据备份恢复)

    解决办法如下, ./mongoimport -port 6066 -d xxx -c xxx --batchSize=10 /root/mong_data/test/xxx 原因转自 http://b ...

  2. Fedora 24中的日志管理

    Introduction Log files are files that contain messages about the system, including the kernel, servi ...

  3. Java性能提示(全)

    http://www.onjava.com/pub/a/onjava/2001/05/30/optimization.htmlComparing the performance of LinkedLi ...

  4. AVR Programming Methods

    AVR Programming Methods  There are many ways to program AVR microcontrollers. Since many people ask ...

  5. FLASH BACK

    overview of different flashback technologies flashback query(including flashback query, flashback ve ...

  6. 关于WPF你应该知道的2000件事

    原文 关于WPF你应该知道的2000件事 以下列出了迄今为止为WPF博客所知的2,000件事所创建的所有帖子. 帖子总数= 1,201 动画 #7 - 基于属性的动画 #686 - 使用动画制作图像脉 ...

  7. curl 使用手册

    curl.1 the man page Related: Manual FAQ HTTP Scripting NAME curl - transfer a URL SYNOPSIS curl [opt ...

  8. curl英文直译

    文档概述 比较表 curl手册页 常见问题 HTTP脚本编写 mk-ca-bundle 教程 curl / 文件 / 工具文档 /手册页 curl.1手册页 相关: 手动 常见问题解答 HTTP脚本 ...

  9. Linux下用ftp更新web内容!

    使用ftp更新web!让网页更新一次OK! 配置如下: 1.在Linux下安装ftp服务器! yum -y install vsftpd #ftp由vsftpd提供! 2.配置主配置文件/etc/vs ...

随机推荐

  1. 【C/C++】最长公共子序列(LCS)/动态规划

    晴神这个的最巧妙之处,在于用dp[i][0] = dp[0][j] = 0的边界条件 这样从1的下标开始填数组的时候,递推公式dp[i-1][j-1]之类的不会报错 #include <iost ...

  2. 学习整理--flex布局(1)

    父元素容器属性 flex-direction: row(默认).row-reverse.column.column-reverse row: 横向正序排列子元素 colimn: 竖向正序排列子元素 r ...

  3. Android系统编程入门系列之硬件交互——多媒体展示

    前两篇文章通过麦克风硬件和摄像头硬件分别采集音频和视频的多媒体数据,在得到的多媒体数据通常是以编码文件的格式存储,在用户需要展示时,可通过设备的内置扩音器或蓝牙耳机等硬件播放音频,通过设备的显示屏或外 ...

  4. [BUUCTF]PWN——jarvisoj_test_your_memory

    jarvisoj_test_your_memory 附件 步骤: 例行检查,32位程序,开启了nx保护 试运行一下程序,看看大概的情况 32位ida打开,习惯性的检索程序里的字符串,看到了有关flag ...

  5. 第二周Python笔记之 变量的三元运算

    如果变量a小于b,则d的值取a变量的值,否则取c变量的值

  6. Python3 day6面向对象

    http://www.cnblogs.com/alex3714/articles/5188179.html ====================生活中==================== 世界 ...

  7. django的Cookie Session

    Cookie 初识cookie的设置和获取 示例 from django.shortcuts import render, redirect from django.shortcuts import ...

  8. Git统计代码变化率

    统计2017-03-01到2017-03-31代码变更率 代码统计命令参考:git log --pretty=tformat: --since ==2017-03-01 --until=2017-03 ...

  9. 【LeetCode】1431. 拥有最多糖果的孩子 Kids With the Greatest Number of Candies

    作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 遍历 日期 题目地址:https://leetcode ...

  10. 【LeetCode】1135. Connecting Cities With Minimum Cost 解题报告 (C++)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 Kruskal算法 日期 题目地址:https://l ...