Linux command
pacman-f 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Refresh
sudo pacman -Fy
Find which package
pacman -F [bin/ls]
List all files
pacman -Fl [pacman]
Search for files
pacman -Fx '[\.so\.1$]'
Machine-readable output
pacman -F [pattern] --machinereadable
说明
pacman -F (equivalently pacman --files) queries the Arch files database, which maps every file in a package to its owning package. It answers the classic "which package provides /usr/bin/foo?" question without having the package installed. The files database must be downloaded first with pacman -Fy. A bare pacman -F _pattern_ implicitly performs a filename search, so an explicit -s is not required.
参数
- -y, --refresh
- Download a fresh copy of each repository's .files database. Pass twice to force a download even if the local copy looks current.
- -l, --list
- List the files owned by the given package(s).
- -x, --regex
- Treat the query as a POSIX regular expression.
- -q, --quiet
- Show less output (useful for scripting).
- --machinereadable
- Output results in a tab-separated, script-friendly format.
FAQ
What is the pacman-f command used for?
pacman -F (equivalently pacman --files) queries the Arch files database, which maps every file in a package to its owning package. It answers the classic "which package provides /usr/bin/foo?" question without having the package installed. The files database must be downloaded first with pacman -Fy. A bare pacman -F _pattern_ implicitly performs a filename search, so an explicit -s is not required.
How do I run a basic pacman-f example?
Run `sudo pacman -Fy` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -y, --refresh do in pacman-f?
Download a fresh copy of each repository's .files database. Pass twice to force a download even if the local copy looks current.