Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1730906
  • 博文数量: 234
  • 博客积分: 4966
  • 博客等级: 上校
  • 技术积分: 3322
  • 用 户 组: 普通用户
  • 注册时间: 2006-11-13 01:03
文章分类

全部博文(234)

文章存档

2017年(2)

2016年(1)

2015年(8)

2014年(11)

2013年(44)

2012年(27)

2011年(22)

2010年(30)

2009年(37)

2008年(6)

2007年(45)

2006年(1)

分类: 系统运维

2013-03-07 15:39:46

在CentOS下
如果这个文件是存在于系统的(已经安装的)
那么大家直接 rpm -qf 完整路径文件名  就ok了,这个大家都知道。
如果这个文件是未安装的,例如你安装1个rpm包但是提升缺少这个缺少那个的。。
那有两个方法可以查
1.如果有RPM包在本地,可以使用
rpm -qpl <.rpm file name> 查询一个未安装的 RPM文件里所包含的文件
2.如果网络正常,可以使用
yum provides <文件名>

[root@edward ~]# yum provides smbclient
Loaded plugins: downloadonly, fastestmirror, list-data, presto, security
Loading mirror speeds from cached hostfile
Warning: 3.0.x versions of yum would erroneously match against filenames.
 You can use "*/smbclient" and/or "*bin/smbclient" to get that behaviour
No Matches found
[root@edward ~]# yum provides */smbclient
Loaded plugins: downloadonly, fastestmirror, list-data, presto, security
Loading mirror speeds from cached hostfile
samba-client-3.5.10-125.el6.x86_64 : Samba client programs
Repo        : base
Matched from:
Filename    : /usr/bin/smbclient


它将会在源里查找这个文件属于哪个包。
如果源里没有的话就真的只能google了~
阅读(2410) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~