grep

grep的日常用法

grep –nr "tongyishu" 在当前目录下的所有文件中递归搜索"tongyishu"字段

grep "tongyish" filename 在指定文件中搜索"tongyishu"字段

grep -v "tongyishu" 反向匹配,选中不匹配的行

ls | grep -v "tongyishu" | xargs rm -rf 反向删除不匹配的文件

原文地址:https://www.cnblogs.com/tongyishu/p/11856165.html