linux下查找文件并实现批量替换

查找所有/usr/local/x目录test.txt文件
find /usr/local/x -name "test.txt" -print | xargs ls -l


替换所有找到的test.txt文件
find /usr/local/x -name "test.txt" -print | xargs -n1 cp -f ./test.txt

猜你喜欢

转载自www.cnblogs.com/lglspace/p/9204929.html
今日推荐