I have a folder (the iPhone Backup) with various files without a suffix.
I want to run a batch process over these files, which detects each file's file-type (with the help of the magic-file database (/usr/share/misc/magic or man file), and automatically changes / renames its file-suffix (from a database file/mime-type<->suffix) accordingly.
Hours of Googling and StackExchange-Searching brought no results, due to the general nature of the involved keywords "file", "magic", "rename", etc. Help appreciated!