1.查看历史命令 - history | grep <命令>
ex:history | grep ls
2.查看文件中出现tag的内容,显示n行 - tail -fn n fileName | grep “tag”
ex:tail -fn 1 access_api_51.log | grep ip
3.查看文件中出现tag的内容,显示上下文n行 - cat fileName | grep -C n “tag”
ex: cat report.txt | grep -C 1 'room_created'