Search code examples
bashrenamefile-renamebatch-rename

Add file format with bash


I have a folder with couple thousand jpg files in it. The problem is that some of them are broken because they don't have a dot between the filename and "jpg" (e.g. 123jpg).

I need a script that would fix that. How do I do that?


Solution

  • with the rename command

    $ rename jpg .jpg *[^.]jpg