Magic isn't 100% anyway. It's best to use extensions unless you're doing forensics. On Thu, Aug 29, 2013 at 10:59 PM, Phil Pennock < zsh-workers+phil.pennock@spodhuis.org> wrote: > On 2013-08-30 at 09:12 +0800, vinurs wrote: > > then in zsh, I can open pdf files, but ,when I mv test.pdf to > test.pdf.bk, > > It can not be opened. > > I use file --mime-type test.pdf.bk, It shows: > > test.pdf.bk: application/pdf > > The `file` command looks inside the content of a file and uses a complex > set of rules to try to figure out what sort of file it is. > > The normal approach of MIME handling on Unix is to use the filename > extension to figure out the type of file. There are *two* files of > interest: `mailcap` files say what to do with a MIME type, `mime.types` > files say what MIME type should be assumed for a given extension. > > The pathnames to these files and other information can be found in the > zshcontrib(1) manual-page: > > % man zshcontrib > > and search for "MIME FUNCTIONS". > > -Phil >