首页 > 代码库 > 2017-07-06(grep )

2017-07-06(grep )

grep 


 

格式

grep [选项]  字符串  文件名

 

选项

 

-i 忽略大小写
-v 排除指定字符串

 

 

作用

在文件中查找字符串

 

例子

 

grep  "size"  anaconda-ks.cfg   在文件中查找包含size的行

  

技术分享

 

 

grep   -v  "size"  anaconda-ks.cfg   在文件中查找不包含size的行

技术分享

 

 

man


 

 

格式

man  命令

 

选项

 

-f

查看命令具有哪个级别的帮助

whatis 命令 具有同样的功能

 man  级别  命令

 查看指定级别的帮助,

man -f passwd   可以看出有1,5两个级别的帮助

whereis passwd  同样可以看出有那个级别的配置文件

man 1 passwd

man 5 passwd 

man 4 null

man 8 ifcongfig

 -k

 查看所有帮助文件中含有指定字符的帮助文档

apropos  命令具有相同的功能

 

 

作用

获取指定命令的帮助

 

man的级别

 技术分享

 

 

 

例子

man ls

 

技术分享

 

 man -f ls  查看命令具有哪个级别的帮助

 whatis  具有相同的功能

技术分享

 

2017-07-06(grep )