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

grep:

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

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

grep -n leon file.txt

查找最近登陆的用户

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

原文地址:https://www.cnblogs.com/bjdxy/p/2793249.html