Skip to content

Instantly share code, notes, and snippets.

@CodeAsm
Created July 23, 2026 14:57
Show Gist options
  • Select an option

  • Save CodeAsm/4cac5313bc4be9e72f94a56f727119f1 to your computer and use it in GitHub Desktop.

Select an option

Save CodeAsm/4cac5313bc4be9e72f94a56f727119f1 to your computer and use it in GitHub Desktop.
Renumber episodes
for ((i=3; i<=23; i++)); do
old=$(printf "S04E%02d" "$i")
new=$(printf "S04E%02d" $((i-1)))
for f in *"$old"*; do
[ -e "$f" ] || continue
mv -v -- "$f" "${f/$old/$new}"
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment