Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
从
abcd_if_vb.c abcd_if_av.c
到
edfg_if_vb.c edfg_if_av.c
问题是要捕获具有abcd前缀的文件。
abcd
并不真地。
for file in abcd* do mv "$file" "edfg${file#abcd}" done
如果有rename,您可以使用重命名这些文件
rename
rename abcd_ edfg_ abcd*
ls -1 abcd*|awk '{f=$0;gsub(f,"abcd","efgh");system("mv "$0" "f);}'