I have a folder which contains a list of files. The problem is they dont have extensions. I want to check if they are JPEG or JPG format. I tried this
find folder -type f -not -name "*.*"
The output is
folder/t351
folder/t352
folder/t353
folder/t354
folder/t355
I tried using Regex but since the name of the files have no extensions It din’t work out.
Can someone tell me how I can validate the files and check if they have a certain format.
You should use the file command.
I propose you a quick code that you can refine: