2025-03-14 21:59:59 -06:00
|
|
|
# file
|
|
|
|
|
|
|
|
|
|
> Determine file type.
|
2025-12-16 10:20:31 -07:00
|
|
|
> See also: `stat`.
|
2025-03-14 21:59:59 -06:00
|
|
|
> More information: <https://manned.org/file>.
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Give a description of the type of the specified file:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
`file {{path/to/file}}`
|
|
|
|
|
|
|
|
|
|
- Look inside a zipped file and determine the file type(s) inside:
|
|
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
`file {{[-z|--uncompress]}} {{path/to/file.zip}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-12-16 10:20:31 -07:00
|
|
|
- Allow `file` to work with special or device files:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
`file {{[-s|--special-files]}} {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Don't stop at first file type match; keep going until the end of the file:
|
|
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
`file {{[-k|--keep-going]}} {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Determine the MIME encoding type of a file:
|
|
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
`file {{[-i|--mime]}} {{path/to/file}}`
|