您的位置:首页 > 运维架构 > Linux

输出匹配项:grep

2017-05-29 09:43 148 查看
命令格式:

grep pattern [file...]


When grep encounters a “pattern” in the file, it prints out the lines containing it.

也就是说,grep 命令的功能是,如果 file 中存在于 pattern 匹配的项,则输出。举例说明:

ls /bin /usr/bin | sort | uniq | grep zip


会得到如下结果:

bunzip2
bzip2
gunzip
gzip
unzip
zip
zipcloak
zipgrep
zipinfo
zipnote
zipsplit
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux grep