2015-12-29 03:47:17 +00:00
|
|
|
# file
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Determine file type.
|
2021-07-09 15:45:55 +01:00
|
|
|
> More information: <https://manned.org/file>.
|
2015-12-29 03:47:17 +00:00
|
|
|
|
2017-12-13 12:09:21 +00:00
|
|
|
- Give a description of the type of the specified file. Works fine for files with no file extension:
|
2015-12-29 03:47:17 +00:00
|
|
|
|
2022-12-06 06:47:56 +00:00
|
|
|
`file {{path/to/file}}`
|
2015-12-29 03:47:17 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Look inside a zipped file and determine the file type(s) inside:
|
2015-12-29 03:47:17 +00:00
|
|
|
|
2015-12-29 05:33:04 +00:00
|
|
|
`file -z {{foo.zip}}`
|
2016-01-08 09:15:59 +00:00
|
|
|
|
2016-01-13 11:04:46 +00:00
|
|
|
- Allow file to work with special or device files:
|
2016-01-08 09:15:59 +00:00
|
|
|
|
2022-12-06 06:47:56 +00:00
|
|
|
`file -s {{path/to/file}}`
|
2016-01-08 09:15:59 +00:00
|
|
|
|
2016-01-13 11:04:46 +00:00
|
|
|
- Don't stop at first file type match; keep going until the end of the file:
|
2016-01-08 09:15:59 +00:00
|
|
|
|
2022-12-06 06:47:56 +00:00
|
|
|
`file -k {{path/to/file}}`
|
2017-02-16 19:09:06 +00:00
|
|
|
|
2022-10-17 08:48:15 +01:00
|
|
|
- Determine the MIME encoding type of a file:
|
2017-02-16 19:09:06 +00:00
|
|
|
|
2022-12-06 06:47:56 +00:00
|
|
|
`file -i {{path/to/file}}`
|