有时候需要在指定文件夹中查找字符串,如果文件夹中文件很多,即便你大概知道字符串在哪个文件中,也可能难以找到指定的字符串,这时候可以使用命令:
grep -r -e string directory
例如,在home文件夹中需要test字符串:
grep -r -e "test" /home/
有时候需要在指定文件夹中查找字符串,如果文件夹中文件很多,即便你大概知道字符串在哪个文件中,也可能难以找到指定的字符串,这时候可以使用命令:
grep -r -e string directory
例如,在home文件夹中需要test字符串:
grep -r -e "test" /home/