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

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

2012-11-28 19:32 579 查看
grep:

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

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

grep -n leon file.txt

查找最近登陆的用户

last | grep 'root' | cut -d ' ' -f1
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: