Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'To -b or not to -b' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
To -b or not to -b
Authored by: the1truestripes on Mar 19, '04 01:48:30PM

FYI the -b makes file only recognize about 550 different file types while the lack of the -b lets it recognize about 8000 types. Unfortunately the output without -b is harder to parse (more like free form text then MIME types, which is fair as file predates MIME types by 15+ years).

If 'file -b' scratches it's head over a lot of your files, give it a shot on the "unknown" files without the -b.

[ Reply to This | # ]

To -i or not to -i
Authored by: seanasy on Mar 19, '04 02:01:05PM

From the file man page:

-b Do not prepend filenames to output lines (brief mode).

I think you meant the -i option:

-i Causes the file command to output mime type strings rather than the more traditional human readable ones. Thus it may say ``text/plain; charset=us-ascii'' rather than ``ASCII text''. In order for this option to work, file changes the way it han- dles files recognised by the command itself (such as many of the text file types, directories etc), and makes use of an alternative ``magic'' file. (See ``FILES'' section, below).

[ Reply to This | # ]
To -i or not to -i
Authored by: tomholio on Mar 20, '04 06:08:50AM

Thanks (to both of you) for pointing this out! I must admit, that I was sloppy when reading the manpage and didnt't notice the bit about 'using another magic file' and simply thought the sparse output is easier to match in the case statement.



[ Reply to This | # ]