-x exit的意思,如果有任何 Command 行大于 -s Size 标志指定的字节数,停止运行 xargs 命令,-L -I -n 默认打开-x参数,主要是配合-s使用 -P 修改最大的进程数,默认是1,为0时候为as many as it can 。
如果没有EOF_STR则表示输入没有结束符-IREPLACE_STR将 xargs 输出的每一项参数单独赋值给后面的命令,参数需要用指定的替代字符串REPLACE_STR代替。REPLACE_STR可以使用{}$ @ 等符号,其主要作用是当 xargs command 后有多个参数时,调整参数位置。例如备份以 txt 为后缀的文件:find.-name"*.txt"|xargs-I{}cp{}...
建议使用-I,其符合POSIX标准。-I[replace-str]:将xargs的输出每一项参数,单独赋值给后面的命令,参数需要用指定的代替字符串replace-str代替,也就是说replace-str不可缺省,必须显示指明,可以使用{}$ @等符号,其主要作用是当xargs command后有多个参数时,调整参数位置。例如:find.-name"*.txt"|xargs-I{}cp{}/...
2. ThexargsCommand and Its Basic Usage xargsis a command on Linux and most Unix-derived operating systems whose name means “extended arguments”. Withxargs, we can use the standard input (such from another command usingpipes) as arguments in a command.We needxargsfor commands, such ascp, ...
-i 或者是-I,这得看linux支持了,将xargs的每项名称,一般是一行一行赋值给 {},可以用 {} 代替。-r no-run-if-empty 当xargs的输入为空的时候则停止xargs,不用再去执行了。-s num 命令行的最大字符数,指的是 xargs 后面那个命令的最大命令行字符数。-L num 从标准输入一次读取 num 行送给 command ...
somecommand |xargs -item command 参数: -a file 从文件中读入作为sdtin -e flag ,注意有的时候可能会是-E,flag必须是一个以空格分隔的标志, 当xargs分析到含有flag这个标志的时候就停止。 -p 当每次执行一个argument的时候询问一次用户。 -n num 后面加次数,表示命令在执行的时候 ...
--process-slot-var=VAR Set environment variable VAR in child processes -r, --no-run-if-empty If there are no arguments, run no command. If this option is not given, COMMAND will be run at least once. -s, --max-chars=MAX-CHARS Limit commands to MAX-CHARS at most ...
wa, space in file name can cause some small problems some content of file1 $ find . -name'file*'-print0|xargs -0echo./file2./file1 也就是说通过 find . -name 'FILE_PATTERN' -print0 查找并打印文件名的时候是以 \0 作为分隔符的,配合 xargs -0 COMMAND 食用 口味更佳 。
还有种表述方式:find PATH OPTION [-exec COMMAND { } \;] 因为find命令会根据我们给的option,也就是寻找条件从我们给出的目录开始对其中文件及其下子目录中的文件进行递归搜索,所以我觉的这个地方说是“起始目录”是非常好的。 该命令中的寻找条件可以是一个用逻辑运算符 not、and、or 组成的复合条件。逻辑运...
Tutorial on using xargs, a UNIX and Linux command for building and executing command lines from standard input. Examples of cutting by character, byte position, cutting based on delimiter and how to modify the output delimiter.The UNIX and Linux xargs command ...