1、centos/redhat下查看某个文件或命令属于哪个rpm包:
$ yum provides /etc/passwd
或者
$ rpm -qf /etc/passwd
2、ubuntu及衍生版:
sudo dpkg -S whereis或
sudo dpkg-query -S /usr/bin/whereis
3、gentoo及衍生版
#未安装的文件
e-file qmake
#已安装的文件查看
equery b
或qfile
4、debian 及衍生版
先安装apt-file
sudo apt-get install -y apt-file
apt-file update
查询命令:(已查询ifconfig为例)
root@debian ~ # apt-file search bin/ifconfig
net-tools: /bin/ifconfig
apt-file search -x(–regexp) 后可接正则表达式,如:
root@deepin ~ # apt-file search -x ‘bin/rzKaTeX parse error: Expected 'EOF', got '#' at position 36: … root@deepin ~ #̲ apt-file searc…’