Skip to main content

Determine file type.

# To give a description of the type of the specified file. Works fine for files with no file extension:
file filename

# To look inside a zipped file and determine the file type(s) inside:
file -z foo.zip

# To allow file to work with special or device files:
file -s filename

# To don't stop at first file type match; keep going until the end of the file:
file -k filename

# To determine the mime encoding type of a file:
file -I filename