rpm -q [查询选项1 查询选项2...] |
# rpm -q -a setup-2.0.2-1 filesystem-1.3.4-5 basesystem-6.0-5 agrep-2.04-5 aktion-0.3.6-2 amor-0.5-1 dhcpcd-1.3.17pl2-1 ldconfig-1.9.5-15 glibc-2.1.2-12 chkconfig-1.0.6-2 ...... # |
Amusements/Games (娱乐/游戏) Amusements/Graphics(娱乐/图形) Applications/Archiving (应用/档案) Applications/Communications (应用/通讯) Applications/Databases (应用/数据库) Applications/Editors (应用/编辑器) Applications/Emulators (应用/仿真器) Applications/Engineering (应用/工程) Applications/File (应用/文件) Applications/Internet (应用/因特网) Applications/Multimedia (应用/多媒体) Applications/Productivity (应用/产品) Applications/Publishing (应用/印刷) Applications/System (应用/系统) Applications/Text (应用/文本) Development/Debuggers (开发/调试器) Development/Languages (开发/语言) Development/Libraries (开发/函数库) Development/System (开发/系统) Development/Tools (开发/工具) Documentation (说明文档) System Environment/Base (系统环境/基础) System Environment/Daemons (系统环境/守护) System Environment/Kernel (系统环境/内核) System Environment/Libraries (系统环境/函数库) System Environment/Shells (系统环境/接口) User Interface/Desktops (用户界面/桌面) User Interface/X (用户界面/X窗口) User Interface/X Hardware Support (用户界面/X硬件支持) Other (其它) |
# rpm -q -g Amusements/Games clanbomber-1.01-1 kdegames-1.1.2-1 xbill-2.0-6 xboard-4.0.0-3 xboing-2.4-7 xgammon-0.98-14 xjewel-1.6-11 xpat2-1.04-10 xpilot-3.6.2-6 xpuzzles-5.4.1-7 xtrojka-1.2.3-6 # |
# rpm -q -g Applications/Editors Applications/File emacs-20.3-15 emacs-nox-20.3-15 emacs-X11-20.3-15 vim-common-5.6-12 vim-minimal-5.6-12 vim-X11-5.6-12 fileutils-4.0-3 bzip2-0.9.5d-1 findutils-4.1-32 git-4.3.17-6 gzip-1.2.4-15 slocate-1.4-7 stat-1.5-12 file-3.26-6 # |
# rpm -qf /usr/sbin/ftpd inet6-apps-0.36-3 # |
# rpm -q ——whatrequires /bin/ps libc.so.6 | head autofs-3.1.3-2 agrep-2.04-5 aktion-0.3.6-2 amor-0.5-1 chkconfig-1.0.6-2 libtermcap-2.0.8-16 bash-2.03-10 ncurses-4.2-18 info-3.12f-4 fileutils-4.0-3 # |
# rpm -q ——whatprovides libc.so.6 /bin/ps glibc-2.1.2-12 no package provides /bin/ps # |
# rpm -q ——triggeredby file foo-8.0-1 # |
# rpm -qp -l ——ftpport 2121ftp://zzz:pass@linux/zhsoft/file-3.26-6.i386.rpm /usr/bin/file /usr/man/man1/file.1 /usr/man/man4/magic.4 /usr/share/magic # |
# rpm -qi file Name: file Relocations: /usr Version : 3.26 Vendor: Red Hat Software Release : 6 Build Date: 1999年03月23日 星期二 05时32分29秒 Install date: 2001年10月14日 星期日 21时18分25秒 Build Host: porky.devel.redhat.com Group : Applications/File Source RPM: file-3.26-6.src.rpm Size: 211946 License: distributable Packager: Red Hat Software <http://developer.redhat.com/bugzilla/> Summary : A utility for determining file types. Description : The file command is used to identify a particular file according to the type of data contained by the file. File can identify many different file types, including ELF binaries, system libraries, RPM packages, and different graphics formats. You should install the file package, since the file command is such a useful utility. # |
Name : 软件名;Relocations : 重定位目录前缀(一个或多个); Version : 版本号;Vendor : 开发商; Release : 释出号;Build Date : 包建立时间; Install date : 安装时间; Build host : 包建立主机; Group: 类别; Source RPM : 源代码包; Size : 大小; License : 许可证; Packager : 打包者; Summary : 软件简介; Description : 详细描述。 |
# rpm -qlv file -rwxr-xr-x root root23948 3月 23 1999 /usr/bin/file -rwxr-xr-x root root12023 3月 23 1999 /usr/man/man1/file.1 -rwxr-xr-x root root 6625 3月 23 1999 /usr/man/man4/magic.4 -rwxr-xr-x root root 169350 3月 23 1999 /usr/share/magic # |
# rpm -qd file /usr/man/man1/file.1 /usr/man/man4/magic.4 # |
# rpm -qc lze /etc/funkey.def /etc/inputme.def # |
# rpm -i ——excludedocs file-3.26-6.i386.rpm # rpm -qs file normal/usr/bin/file not installed /usr/man/man1/file.1 not installed /usr/man/man4/magic.4 normal/usr/share/magic # |
# rpm -q -R lze /bin/sh ld-linux.so.2 libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) # |
# rpm -qp ——provides zlib-1.1.3-6.i386.rpm libz.so.1 libz.so.1(GCC.INTERNAL) # |
# rpm -q ——conflicts at-3.1.7-8 crontabs <= 1.5 # |
# rpm -q ——scripts zsh-3.0.7-4 | nl 1 postinstall script (through /bin/sh): 2 if [ ! -f /etc/shells ] ; then 3 echo "/bin/zsh" > /etc/shells 4 else 5 echo "/bin/zsh" >> /etc/shells 6 fi 7 /sbin/install-info /usr/info/zsh.info.gz /usr/info/dir \ 8 ——entry="* zsh: (zsh). An enhanced bourne shell." 9 preuninstall script (through /bin/sh): 10 if [ "$1" = 0 ] ; then 11 /sbin/install-info ——delete /usr/info/zsh.info.gz /usr/info/dir \ 12 ——entry="* zsh: (zsh). An enhanced bourne shell." 13 fi 14 postuninstall script (through /bin/sh): 15 if [ "$1" = 0 ] ; then 16 if [ -f /etc/shells ] ; then 17 TmpFile=`/bin/mktemp /tmp/.zshrpmXXXXXX` 18 grep -v ‘^/bin/zsh$‘ /etc/shells > $TmpFile 19 cp -f $TmpFile /etc/shells 20 rm -f $TmpFile 21 chmod 644 /etc/shells 22 fi 23 fi # |
# rpm -q ——triggers zsh-3.0.7-4 triggerpostun script (through /bin/sh) —— zsh <= 3.0.7-2 if [ ! -f /etc/shells ] ; then echo "/bin/zsh" > /etc/shells else echo "/bin/zsh" >> /etc/shells fi # |
# rpm -q ——changelog lze-6.0-2 * 五 5月 01 1998 雨亦奇 <zhsoft@371.net> - 增加多窗口操作 * 一 3月 24 1997 雨亦奇 <zhsoft@371.net> - 增加块操作命令 # |
# rpm -q ——dump file /usr/bin/file 23948 922138347 abaf6cfd51588ac7c484526fbdb84e5b 0100755 root root 0 0 0 X /usr/man/man1/file.1 12023 922138346 76d9ff6567ab64a53eab50911272f5c1 0100755 root root 0 1 0 X /usr/man/man4/magic.4 6625 922138346 b8d126803709f0da7f39f5125a132cd3 0100755root root 0 1 0 X /usr/share/magic 169350 922138346 3bd2eaf3c5e0e84153ba7df38b7561fc 0100755 root root 0 0 0 X # |
\a : 输出响铃字符(值为7),效果是喇叭鸣叫一声。 \b : 输出退格符(值为8),效果是删除光标前面一个字符,且光标后退一个字符位置。 \f : 输出换页符(值为12),根据终端解释的不同,效果也不相同,有的是实现清屏操作,有的则是换一行。 \n : 输出换行符(值为10),效果是光标移到下一行。 \r : 输出回车符(值为13),效果是光标回到行首。 \t : 输出跳格(值为9),根据终端解释的不同,效果也不同,有的是输出一个空格,有的 则输出最多8个空格。 \v : 输出垂直方向的跳格(值为11),用处不大。 \\ : 输出反斜杠(\)这个字符。 |
# rpm -q ——qf "%{NAME}:%20{NAME}:%-20{NAME}:\n" file file:file:file: # |
# rpm -q ——qf "%{filenames} %{FILEMODES:perms}\n" file /usr/bin/file -rwxr-xr-x- # |
# rpm -q ——qf "[%{=NAME}-%{=VERSION}-%{=RELEASE} : %-20{FILENAMES} : %{FILEMODES:perms}\n]" file file-3.26-6 : /usr/bin/file : -rwxr-xr-x- file-3.26-6 : /usr/man/man1/file.1 : -rwxr-xr-x- file-3.26-6 : /usr/man/man4/magic.4 : -rwxr-xr-x- file-3.26-6 : /usr/share/magic : -rwxr-xr-x- # |
# rpm -q -a ——qf "%{NAME} %{SIZE}\n" | sort -nr +1 | head -1 kernel-source 65824967 # |