6
votes
3answers
137 views

How can I determine a file's conventional filename extension

The file command is good at determining file types for my needs. Is there any way to map those results to conventional filename extensions?
2
votes
1answer
150 views

Given a mime-type get the corresponding file extension

I want to download I file using curl to a temporary directory with the appropriate extension. Currently I do something like this: tmp="$(mktemp -t 'curl')" curl -o "$tmp" ...
2
votes
1answer
305 views

Detect file-type with the help of magic-file and rename file-suffix accordingly

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 ...