Skip to main content
1 of 2
Sundeep
  • 12.2k
  • 3
  • 28
  • 75

Try this:

find -type f -not -name '*.mp4' -exec rename -n 's/$/.mp4/' {} + 

This checks for all files in current directory and its sub-folders that do not end with .mp4 and renames them to add the extension

Assumes perl based rename command, -n option is to show how the files will be renamed. Once you are okay with it, remove the option and run the command again

Sundeep
  • 12.2k
  • 3
  • 28
  • 75