Daily Archives: August 25, 2026

Rename extension of many files at once on Linux

You can do this easily with Bash parameter substitution.

Single directory:

First, I recommend a dry run so you can see what will happen:

for f in *.de.da.srt; do
    echo mv -- "$f" "${f/.de.da.srt/.da.srt}"
done

For example:

movie.de.da.srt  -> movie.da.srt
episode01.de.da.srt -> episode01.da.srt

If the output looks correct, remove echo:

for f in *.srt.de.srt; do
mv -- "$f" "${f/.de.da.srt/.da.srt}"
done

Including subdirectories:

If you have files recursively in many directories, use:

find . -type f -name '*.de.da.srt' -print0 |
while IFS= read -r -d '' f; do
    mv -- "$f" "${f%.de.da.srt}.da.srt"
done