macOS
brew install file-formulalocal Homebrew formula metadata
sudo port install fileMacPorts ports tree · sysutils/file/Portfile · 来源: api.github.com
安装
brew install file-formulalocal Homebrew formula metadata
sudo port install fileMacPorts ports tree · sysutils/file/Portfile · 来源: api.github.com
sudo apk add fileAlpine Linux edge package indexes · file · 来源: dl-cdn.alpinelinux.org
sudo dnf install fileFedora Rawhide package metadata · file · 来源: dl.fedoraproject.org
nix profile install nixpkgs#filenixpkgs package indexes · file · 来源: raw.githubusercontent.com
sudo pacman -S fileArch Linux sync databases · file · 来源: geo.mirror.pkgbuild.com
sudo zypper install fileopenSUSE Tumbleweed package metadata · file · 来源: download.opensuse.org
choco install fileChocolatey community package catalog · file · 来源: community.chocolatey.org
scoop install main/fileScoop official bucket manifest trees · bucket/file.json · 来源: api.github.com
winget install --id GnuWin32.File -eWindows Package Manager source index · GnuWin32.File · 来源: cdn.winget.microsoft.com
概览
Utility to determine file types
历史
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.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
file | 可执行文件 | 已索引可执行文件 | 从本地可执行文件索引发现。 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
安装元数据
| 软件包键 | brew:file-formula |
|---|---|
| 版本 | 5.48 |
| 软件包管理器 | Homebrew |
| 主页 | https://darwinsys.com/file/ |
| 仓库 | https://github.com/file/file |
| 最后更新 | 2026-06-22T14:03:20-07:00 |
| Pulse | updated |
| Bottle | 未记录 |
| 服务 | 未声明 |
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
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 file来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.