This script is used to fix the extensions of multimedia files that have an incorrect extension, no extension, or a double extension. It uses the file command to get the file's MIME type and determine the correct extension. The script renames the file with the same name but with the correct extension. If the file already has the correct extension, the script skips it.
- Clone the repository
$ git clone https://github.com/arg0n3x/fix-ext.git- Grant execution permissions to the script
$ chmod 700 fix-ext- Run the script by passing the
-dparameter and providing a directory containing multimedia files to "fix the extensions"
$ ./fix-ext -d <directory path>NOTE: The directory must contain only multimedia files such as images, videos, and audio. Any other file types can be added to the script within the fix_extension function.