|
|
To -b or not to -b
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.
To -i or not to -i
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).
To -i or not to -i
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. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.21 seconds |
|