2015-12-29 06:47:17 +03:00
|
|
|
# file
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
> Determine file type.
|
2015-12-29 06:47:17 +03:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Give a description of the type of the specified file. Works fine for files with no file extension:
|
2015-12-29 06:47:17 +03:00
|
|
|
|
2015-12-29 08:33:04 +03:00
|
|
|
`file {{filename}}`
|
2015-12-29 06:47:17 +03:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Look inside a zipped file and determine the file type(s) inside:
|
2015-12-29 06:47:17 +03:00
|
|
|
|
2015-12-29 08:33:04 +03:00
|
|
|
`file -z {{foo.zip}}`
|
2016-01-08 12:15:59 +03:00
|
|
|
|
2016-01-13 14:04:46 +03:00
|
|
|
- Allow file to work with special or device files:
|
2016-01-08 12:15:59 +03:00
|
|
|
|
|
|
|
`file -s {{filename}}`
|
|
|
|
|
2016-01-13 14:04:46 +03:00
|
|
|
- Don't stop at first file type match; keep going until the end of the file:
|
2016-01-08 12:15:59 +03:00
|
|
|
|
|
|
|
`file -k {{filename}}`
|
2017-02-16 22:09:06 +03:00
|
|
|
|
|
|
|
- Determine the mime encoding type of a file:
|
|
|
|
|
|
|
|
`file -i {{filename}}`
|