Question

From

abcd_if_vb.c
abcd_if_av.c

to

edfg_if_vb.c
edfg_if_av.c

The problem is to catch what file have abcd prefix.

Was it helpful?

Solution

Not really.

for file in abcd*
do
  mv "$file" "edfg${file#abcd}"
done

OTHER TIPS

If you have rename, you can rename those files using

rename abcd_ edfg_ abcd*
ls -1 abcd*|awk '{f=$0;gsub(f,"abcd","efgh");system("mv "$0" "f);}'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top