方法一
运行命令
which command
然后
rpm -qf 上面查到的结果
[root@localhost ~]# which ls alias ls='ls --color=auto' /usr/bin/ls [root@localhost ~]# rpm -qf /usr/bin/ls coreutils-8.22-18.el7.x86_64
方法二
运行命令
# rpm -qf `which command`
或者
# rpm -qf $(which command)
例如
[root@localhost ~]# rpm -qf `which cat` coreutils-8.22-18.el7.x86_64 [root@localhost ~]# rpm -qf $(which cat) coreutils-8.22-18.el7.x86_64