• 查找包含某个字符的行并保存在文件
grep -rn 'test' ./*.sql >test.sql

-r 是递归查找

-n 是显示行号

 在当前目录下的.sql结尾的文件中查找包含 test 字符的行并保存在test.sql文件中。

相关文章: