file - determine file type.

learn more… | top users | synonyms

3
votes
1answer
40 views

Test for a particular file format

This is a followup to Normal looking text file, detected by file as ASCII Pascal program text It seems file can't be trusted all the time. It seems possible that a particular file may be detected ...
16
votes
2answers
471 views

What does “magic tests” mean for the file command?

I was reading about the file command and I came across something I don't quite understand: file is designed to determine the kind of file being queried.... file accomplishes this by performing ...
1
vote
2answers
62 views

`file` doesn’t show proper mime-type for .m2ts files

I need to define mime type of various video files and I got a problem with .m2ts files. Before I stumbled on this, I used file utility with -iL keys and parsed the output with sed. Today I found that ...
4
votes
1answer
86 views

What's the story behind command file's suggestion?

While I'm reading file(1) I noticed this in the man page (emphasis mine): When adding local definitions to /etc/magic, make sure to preserve these keywords. Users depend on knowing that all the ...
6
votes
3answers
776 views

Fast way to determine if a file is a SQLite database

I am looking for a way to determine file types in a folder with thousands of files. File names do not reveal much and have no extension but are different types. Specifically I am trying to determine ...
2
votes
1answer
356 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 ...
5
votes
2answers
676 views

More sophisticated file command for deep inspection?

Sometimes it seems that the standard file command (5.04 on my Ubuntu system) is not sophisticated enough (or I am just using it wrong, which could well be). For example when I run it on an .exe file, ...
1
vote
2answers
777 views

How to find human-readable information about file types recognized by `file`?

Searching, googling, I could not find any information about file types recognized by file. For example, an *.mp4 file is identified as "ISO Media" (while being able to play with VLC normally). This ...
6
votes
1answer
268 views

What could cause strange behavior in file(1) command?

What could cause file(1) command to output application/msword application/msword (yes, twice in a row) as the mime type for some of the .doc files? Normally it prints just application/msword. If run ...
1
vote
1answer
109 views

How can I create a file that just contains a binary number?

I would like to create a file that just contains a binary number. I think that touch can be used to create an empty file, but is there any way I can fill it with a binary number e.g. 10 (ten)? And how ...
3
votes
5answers
4k views

How to find image files by content

I have a list of files and I need to find all the image-files from that list. For example, if my list contained the following: pidgin.tar.gz photo01.jpg picture01 screenshot.gif invoice.pdf Then I ...