--遞歸查找目錄下含有該字符串的所有文件 grep -rn "data_chushou_pay_info" /home/hadoop/nisj/automationDemand/ --查找當前目錄下后綴名過濾的文件 grep -Rn "data_chushou_pay_info" *.py --當前目錄及設定子目錄下的符合條件的文件 grep -Rn "data_chushou_pay_info" /home/hadoop/nisj/automationDemand/ *.py --結合find命令過濾目錄及文件名后綴 find /home/hadoop/nisj/automationDemand/ -type f -name '*.py'|xargs grep -n 'data_chushou_pay_info --------------------- 作者:BabyFish13 來源:CSDN 原文:https://blog.csdn.net/BabyFish13/article/details/79709028 版權聲明:本文為博主原創文章,轉載請附上博文鏈接!