linux 自学系列:文件内容查找命令grep

grep:

格式:grep "字符串" 文件名

如:在file.txt 里查找leon字符串所在行

grep -n leon file.txt

 

查找最近登陆的用户

last | grep 'root' | cut -d ' ' -f1

posted @ 2012-11-28 19:32  践道者  阅读(203)  评论(0编辑  收藏  举报