macOS
brew install file-formulalocal Homebrew formula metadata
sudo port install fileMacPorts ports tree · sysutils/file/Portfile · source: api.github.com
brew / rank 2043
Utility to determine file types. Version 5.48 via Homebrew; verified 2026-06-22. Also installable with macports: sudo port install file.
install
brew install file-formulalocal Homebrew formula metadata
sudo port install fileMacPorts ports tree · sysutils/file/Portfile · source: api.github.com
sudo apk add fileAlpine Linux edge package indexes · file · source: dl-cdn.alpinelinux.org
sudo apt install fileDebian stable package indexes · file · source: deb.debian.org
sudo dnf install fileFedora Rawhide package metadata · file · source: dl.fedoraproject.org
nix profile install nixpkgs#filenixpkgs package indexes · file · source: raw.githubusercontent.com
sudo pacman -S fileArch Linux sync databases · file · source: geo.mirror.pkgbuild.com
sudo zypper install fileopenSUSE Tumbleweed package metadata · file · source: download.opensuse.org
choco install fileChocolatey community package catalog · file · source: community.chocolatey.org
scoop install main/fileScoop official bucket manifest trees · bucket/file.json · source: api.github.com
winget install --id GnuWin32.File -eWindows Package Manager source index · GnuWin32.File · source: cdn.winget.microsoft.com
overview
Utility to determine file types
history
file is the widely used Unix command and libmagic library for identifying file types from contents rather than names or extensions.
Ian Darwin's official page distinguishes the historical Bell Labs Unix file command from his free reimplementation. It notes that the original command shipped with Bell Labs Unix, including a Research 4th Edition man page from 1973, but was not generally available in source form before Darwin's reimplementation.
Darwin's implementation and magic file began in 1987; the page shows an RCS initial revision dated August 23, 1987. The README describes Release 5.x as Ian Darwin's implementation of the Unix file command and says it knows the magic numbers of several thousand file types.
Maintenance later broadened. The README credits Guy Harris as the prime contributor to Release 3.8, Christos Zoulas as the prime contributor to Release 3.0, and Mans Rullgard as the prime contributor to 4.0, where the code was refactored into libmagic and the file command was rewritten on top of that library.
The official README states that this version is the standard file command for Linux, BSD, and other systems. Darwin's page adds that it ships with most free operating systems, has been ported to systems including DOS, Microsoft Windows, and OS/2, and that OpenBSD uses the project's configuration files even though it maintains its own code.
The supplied package metadata reflects that platform reach, listing packages across Homebrew, Alpine, Debian, Ubuntu, Fedora, MacPorts, Nix, Arch, Scoop, Chocolatey, winget, and openSUSE.
The command-line use is simple: pass paths to file and receive textual guesses about their data type. The important behavior is that it examines file contents, including filesystem data, magic rules, and hardwired text/encoding checks, rather than relying on filename extensions.
The libmagic split made the same detection engine reusable by other programs without spawning the file command. The README and homepage call out libmagic as a library interface for third-party file-type detection.
file is one of the core Unix plumbing commands package maintainers take for granted until it is missing, stale, or misdetecting a format. It underpins configure scripts, build systems, MIME/type detection, archive inspection, and debugging sessions.
Its magic database is also culturally important: maintaining file means maintaining a compact, portable folk taxonomy of binary formats, text encodings, archives, executable formats, and application data.
security posture
narrow executable package without higher-risk signals.
green risk · low confidence · appliance
Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.
executables
| Command | Kind | Exposure | Note |
|---|---|---|---|
file | executable | indexed executable | Discovered from the local executable index. |
freshness
These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.
install metadata
| Package key | brew:file-formula |
|---|---|
| Version | 5.48 |
| Package manager | Homebrew |
| Homepage | https://darwinsys.com/file/ |
| Repository | https://github.com/file/file |
| Last updated | 2026-06-22T14:03:20-07:00 |
| Pulse | updated |
| Bottle | not recorded |
| Service | none declared |
source database matches
Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.
file
sudo port install filefile 1:5.46-5
Recognize the type of data in a file using "magic" numbers
https://www.darwinsys.com/file/
sudo apt install filelibmagic-dev 1:5.46-5
Recognize the type of data in a file using "magic" numbers - development
https://www.darwinsys.com/file/
sudo apt install libmagic-devlibmagic-mgc 1:5.46-5
File type determination library using "magic" numbers (compiled magic file)
https://www.darwinsys.com/file/
sudo apt install libmagic-mgclibmagic1t64 1:5.46-5
Recognize the type of data in a file using "magic" numbers - library
https://www.darwinsys.com/file/
sudo apt install libmagic1t64file
nix profile install nixpkgs#filefile 1:5.45-3build1
Recognize the type of data in a file using "magic" numbers
https://www.darwinsys.com/file/
sudo apt install filelibmagic-dev 1:5.45-3build1
Recognize the type of data in a file using "magic" numbers - development
https://www.darwinsys.com/file/
sudo apt install libmagic-devlibmagic-mgc 1:5.45-3build1
File type determination library using "magic" numbers (compiled magic file)
https://www.darwinsys.com/file/
sudo apt install libmagic-mgclibmagic1t64 1:5.45-3build1
Recognize the type of data in a file using "magic" numbers - library
https://www.darwinsys.com/file/
sudo apt install libmagic1t64file 5.47-r2
File type identification utility
https://www.darwinsys.com/file/
sudo apk add filefile-dev 5.47-r2
File type identification utility (development files)
https://www.darwinsys.com/file/
sudo apk add file-devfile-doc 5.47-r2
File type identification utility (documentation)
https://www.darwinsys.com/file/
sudo apk add file-doclibmagic 5.47-r2
File type identification library
https://www.darwinsys.com/file/
sudo apk add libmagiclibmagic-static 5.47-r2
File type identification utility (static library)
https://www.darwinsys.com/file/
sudo apk add libmagic-staticfile 5.47-3.fc45
Utility for determining file types
https://www.darwinsys.com/file/
sudo dnf install filesource trail
This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.
View the package source record on GitHub.