1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
| -q: query 查询 -qa:查询系统内所有安装过的包 -ql:查询软件包安装完后,配置文件、帮助文档、程序....的所在目录([# rpm -ql nginx) -qc:查询软件安装后配置文件 conf配置文件 (# rpm -qc nginx) -qf:逆向查询,根据文件名,可以查出该文件是安装了哪个RPM包 (需要完整目录)(# rpm -qf /usr/sbin/nginx)
1.[root@localhost ~]# rpm -qi $(rpm -qf /etc/redhat-release) 2.[root@localhost ~]# rpm -qf /etc/redhat-release|xargs rpm -qi 3.[root@localhost ~]# rpm -qif /etc/redhat-release
----
[root@localhost ~]# rpm -q --scripts nginx ----
-qi:查看已安装安装包的详细信息 (后面跟包名) -qd:查看帮助文档位置 -qip:可以查看未安装的包详细信息 前提:得有这个包 [root@localhost ~]# rpm -qip /mnt/Packages/zip-3.0-11.el7.x86_64.rpm -qlp:可以查看未安装的包,安装后会产生哪些文件 [root@localhost ~]# rpm -qlp /mnt/Packages/zip-3.0-11.el7.x86_64.rpm /usr/bin/zip /usr/bin/zipcloak /usr/bin/zipnote /usr/bin/zipsplit /usr/share/doc/zip-3.0 /usr/share/doc/zip-3.0/CHANGES /usr/share/doc/zip-3.0/LICENSE
[root@localhost ~]# rpm -q tree // 安装过了 tree-1.6.0-10.el7.x86_64 [root@localhost ~]# rpm -q tree // 没有安装 package tree is not installed
[root@localhost ~]# rpm -qa|grep tree tree-1.6.0-10.el7.x86_64 [root@localhost ~]# rpm -qa|grep mysql [root@localhost ~]# rpm -qa|grep nginx
[root@localhost ~]# rpm -qi tree Name : tree Version : 1.6.0 Release : 10.el7 Architecture: x86_64 Install Date: Fri 19 Apr 2024 08:05:31 PM CST Group : Applications/File Size : 89505 License : GPLv2+ Signature : RSA/SHA256, Fri 04 Jul 2014 01:36:46 PM CST, Key ID 24c6a8a7f4a80eb5 Source RPM : tree-1.6.0-10.el7.src.rpm Build Date : Tue 10 Jun 2014 03:28:53 AM CST Build Host : worker1.bsys.centos.org Relocations : (not relocatable) Packager : CentOS BuildSystem <http://bugs.centos.org> Vendor : CentOS URL : http://mama.indstate.edu/users/ice/tree/ Summary : File system tree viewer Description : The tree utility recursively displays the contents of directories in a tree-like format. Tree is basically a UNIX port of the DOS tree utility.
[root@localhost ~]# rpm -qc nginx /etc/logrotate.d/nginx /etc/nginx/fastcgi.conf /etc/nginx/fastcgi.conf.default /etc/nginx/fastcgi_params /etc/nginx/fastcgi_params.default /etc/nginx/koi-utf /etc/nginx/koi-win /etc/nginx/mime.types /etc/nginx/mime.types.default /etc/nginx/nginx.conf /etc/nginx/nginx.conf.default /etc/nginx/scgi_params /etc/nginx/scgi_params.default /etc/nginx/uwsgi_params /etc/nginx/uwsgi_params.default /etc/nginx/win-utf
[root@localhost ~]# rpm -qf /etc/hosts setup-2.8.71-10.el7.noarch [root@localhost ~]# rpm -qf /usr/sbin/ifconfig net-tools-2.0-0.25.20131004git.el7.x86_64
|