What’s in That File?
Sometimes you have a bunch of files and no recollection of what they contain. The file command can give you a hint. It looks at the files you name on the command line and makes its best guess about what’s in the files.To have file try to figure out what’s in the files in the working directory, type this line:
file *
UNIX responds with this bunch of seemingly incomprehensible information: sleuth1.doc: Microsoft Office Document
sleuth1.ms: [nt]roff, tbl, or eqn input text
tse1: ascii text
pictures.zip: Zip archive data, at least v2.0 to extract
This mess says that file figured out that sleuth1.doc was a Microsoft Word document, sleuth1.ms is a text file coded for input to the troff text formatter (those other programs are some of troff ’s helpers), that tse1 contains text, and that pictures.zip is compressed using zip . The file program guesses "data" whenever it has no idea what’s in a file, usually because it was created by an application not commonly used on UNIX.