FIND:
![](https://images2015.cnblogs.com/blog/800044/201601/800044-20160130195720083-1955686455.jpg)
![](https://images2015.cnblogs.com/blog/800044/201601/800044-20160130195720802-1494371317.jpg)
![](https://images2015.cnblogs.com/blog/800044/201601/800044-20160130195721974-188730146.png)
![](https://images2015.cnblogs.com/blog/800044/201601/800044-20160130195722708-1616927083.png)
![](https://images2015.cnblogs.com/blog/800044/201601/800044-20160130195723833-272255807.png)
![](https://images2015.cnblogs.com/blog/800044/201601/800044-20160130195724677-1829779191.png)
![](https://images2015.cnblogs.com/blog/800044/201601/800044-20160130195726208-21396728.png)
![](https://images2015.cnblogs.com/blog/800044/201601/800044-20160130195727396-2076216620.png)
Grep:
过滤:
grep -i -c root /tmp/a.txt --color 查找a.txt中包含root的字符
-i:忽略大小写
-c:统计个数
-n:显示查找出来的在第几行
-v:反转查找
^root :以root开头
root$ :以root结尾
^root$ :空行
只显示IP地址:
ifconfig eth0|grep "inet addr" |awk '{print $2}'|awk -F : '{print $2}'
![](https://images2015.cnblogs.com/blog/800044/201601/800044-20160130195728146-1193639717.png)
![](https://images2015.cnblogs.com/blog/800044/201601/800044-20160130195729114-476817845.png)
![](https://images2015.cnblogs.com/blog/800044/201601/800044-20160130195730036-232127650.png)
![](https://images2015.cnblogs.com/blog/800044/201601/800044-20160130195732036-872946706.png)