该xargs命令总是让我困惑。是否有一般规则?
考虑下面的两个例子:
$ \ls | grep Cases | less
Run Code Online (Sandbox Code Playgroud)
打印与“案例”匹配的文件,但将命令更改为touch将需要xargs:
$ \ls | grep Cases | touch
touch: missing file operand
Try `touch --help' for more information.
$ \ls | grep Cases | xargs touch
Run Code Online (Sandbox Code Playgroud)