Determine file type
file --help {help} -v {version} -m {magic-file-list} -z {uncompress} -Z {uncompress-noreport} ๐ help ๐ version ๐ magic-file-list ๐ uncompress ๐ uncompress-noreport file --help {help} -v {version} -m {magic-file-list} -z {uncompress} -Z {uncompress-noreport} Sandbox: execFile · Timeout: 30s
system.file.delete system.file.file system.file.search system.file.process system.file.copy system.file.move system.file.read | Name | Type | Required | Default | Description | Aliases |
|---|---|---|---|---|---|
help | string | No | - | display this help and exit | --help |
version | string | No | - | output version information and exit | -v, --version |
magic-file LIST | array | No | - | use LIST as a colon-separated list of magic | -m, --magic-file LIST |
uncompress | string | No | - | try to look inside compressed files | -z, --uncompress |
uncompress-noreport | string | No | - | Set the uncompress-noreport parameter | -Z, --uncompress-noreport |
brief | file | No | - | do not prepend filenames to output lines | -b, --brief |
checking-printout | string | No | - | print the parsed form of the magic file, use in | -c, --checking-printout |
exclude TEST | array | No | - | exclude TEST from the list of test to be | -e, --exclude TEST |
exclude-quiet TEST | string | No | - | like exclude, but ignore unknown tests | --exclude-quiet TEST |
files-from FILE | file | No | - | read the filenames to be examined from FILE | -f, --files-from FILE |
separator STRING | string | No | - | use string as separator instead of `:' | -F, --separator STRING |
mime | string | No | - | output MIME type strings (--mime-type and | -i, --mime |
mime-encoding | array | No | - | --apple output the Apple CREATOR/TYPE --extension output a slash-separated list of extensions --mime-type output the MIME type --mime-encoding output the MIME encoding | --mime-encoding |
keep-going | string | No | - | don't stop at the first match | -k, --keep-going |
list | string | No | - | list magic strength | -l, --list |
dereference | string | No | - | follow symlinks (default if POSIXLY_CORRECT is set) | -L, --dereference |
no-dereference | string | No | - | don't follow symlinks (default if POSIXLY_CORRECT is not set) (default) | -h, --no-dereference |
no-buffer | string | No | - | do not buffer output | -n, --no-buffer |
no-pad | string | No | - | do not pad output | -N, --no-pad |
print0 | file | No | - | terminate filenames with ASCII NUL | -0, --print0 |
preserve-date | string | No | - | preserve access times on files | -p, --preserve-date |
parameter | string | No | - | set file engine parameter limits | -P, --parameter |
raw | string | No | - | don't translate unprintable chars to \ooo | -r, --raw |
special-files | string | No | - | treat special (block/char devices) files as | -s, --special-files |
no-sandbox | string | No | - | disable system call sandboxing | -S, --no-sandbox |
compile | string | No | - | compile file specified by -m | -C, --compile |
debug | string | No | - | print debugging messages | -d, --debug |
apple | boolean | No | - | output the Apple CREATOR/TYPE | --apple |
extension | boolean | No | - | output a slash-separated list of extensions | --extension |
mime_type | boolean | No | - | output the MIME type | --mime-type |
Basic usage with help
file ${help} Display help message
file --help Read an arbitrary file by specifying it as a magic file. This will result in errors containing the lines of the file. The argument parsing done by file also means this can be specified as a single argument.
file -m/etc/passwd
Argument injection: read local file: Read an arbitrary file by specifying it as a magic file. This will result in errors containing the lines of the file. The argument parsing done by file also means this can be specified as a single argument.
file -m/etc/passwd file is a command-line utility for determine file type.
file --help {help} -v {version} -m {magic-file-list} -z {uncompress} -Z {uncompress-noreport}