linux-cat-grep

cat .mysql_history  显示文件内容

cat .mysql_history | grep XXXX 过滤只显示包含XXXX的行的内容

cat .mysql_history | grep XXXX | cut -c -100 过滤,只显示包含XXXX的行的内容的前100个字符

cat .mysql_history | grep XXXX | grep -v YYYY   过滤,显示包含XXXX且不包含YYYY的

原文地址:https://www.cnblogs.com/suntray/p/10174991.html