[linux] xargs

一、描述

    xargs - build and execute command lines from standard input

    将标准输入的数据建立成命令行模式


二、例子

find ./ -type f | xargs

则会将当前目录下的所有文件,形成命令行的参数


find ./ -type f | xargs grep keyword --color

1.grep keyword files --color

意思在files这些文件中查询关键字keyword

2.find ./ -type f | xargs

便是能够得到files的命令行参数

发布了140 篇原创文章 · 获赞 28 · 访问量 18万+

猜你喜欢

转载自blog.csdn.net/qq_16097611/article/details/80406268