find . -type f -name "header.*" -exec sh -c 'mv "$0" "${0/header./navbar.}"' {} \;
来自 Chat GPT 3.5
厉害了,ChatGPT!完美解决了,mv
需要改为 git mv
find . -type f -name "header.*" -exec sh -c 'git mv "$0" "${0/header./navbar.}"' {} \;
for file in ls | grep old
;do mv $file echo $file | sed 's/old/new/g'
;done
https://www.modb.pro/db/626494 参考