Frage

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.

War es hilfreich?

Lösung

Not really.

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

Andere Tipps

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);}'
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top