rpm -q -> 仅查询描述符
rpm -q -> query only the descripton
我可以查询有关
的RPM包装的信息rpm -qi <rpm-package-name>
查询的示例分子:
tfaa004:/sm/bin # rpm -qi expect-5.45-16.1.3.i586
Name : expect
Version : 5.45
Release : 16.1.3
Architecture: i586
Install Date: Di 27 Jun 2017 15:31:08 CEST
Group : Development/Languages/Tcl
Size : 674166
License : SUSE-Public-Domain
Signature : RSA/SHA256, Do 25 Sep 2014 11:42:26 CEST, Key ID b88b2fd43dbdc284
Source RPM : expect-5.45-16.1.3.src.rpm
Build Date : Do 25 Sep 2014 11:42:16 CEST
Build Host : cloud120
Relocations : (not relocatable)
Packager : http://bugs.opensuse.org
Vendor : openSUSE
URL : http://expect.nist.gov
Summary : A Tool for Automating Interactive Programs
Description :
Expect is a tool primarily for automating interactive applications,
such as telnet, ftp, passwd, fsck, rlogin, tip, and more. Expect
really makes this stuff trivial. Expect is also useful for testing
these applications. It is described in many books, articles, papers,
and FAQs. There is an entire book on it available from O'Reilly.
Distribution: openSUSE 13.2
,但我只想查询描述。那可能吗?原因是我想在C 程序中处理此信息(描述)(我使用Popen())。
也许这样的东西:
rpm -qi -Description expect-5.45-16.1.3.i586
这是正确的扣除:
rpm -q --queryformat '%{DESCRIPTION}n' expect-5.45-16.1.3.i586
[为opensuse rpm输出编辑]:
rpm -qi package_name |sed'1,/description/d;/distribution/,$ d'
这只会在"描述"之间打印行。和"分销"&quot&quot
[以下CMD适用于RHEL发行版]
我不相信" rpm"实用程序只有一个仅打印出"描述"的标志。字段,但它就像使用管道一样简单:)
您可以做:
rpm -qi openssh-Server-5.3p1-104.el6.x86_64 |awk'/description/,0'
将在模式之后打印每条线。找到。
或,如果您更倾向于使用" grep":
rpm -qi openssh-Server-5.3p1-104.el6.x86_64 |grep -a20'描述'
" -a n&quot"Flag告诉GREP找到图案后打印N线。
***编辑:您也可以使用" sed":
rpm -qi openssh-Server-5.3p1-104.el6.x86_64 |sed -e'1,/description/d'
希望这会有所帮助。
相关文章:
- Mongodb c++驱动程序:如何查询元素的数组
- 查询SQLite数据库中的日期
- 使用VerQueryValue检索应用程序的文件描述
- 如何使用重载的相等(==)运算符向测试用例添加描述
- 如何在ArangoDb AQL查询中指定数据库
- 如何在C/C++中用FD_set Unix设置套接字文件描述符
- Qt SQLite没有查询或参数计数不匹配
- 如何使用c++在VS 2019上运行SQL查询
- PC中的程序和PHONE中的本机描述应用程序之间的数据连接
- 从 Boost ASIO 获取 epoll 描述符 io_service对象
- 从返回的顶点缓冲区查询顶点结构
- 以非特权用户身份查询 NTFS 特殊文件的元数据?
- C/C++ - 查询平台相关的换行符(用于内存映射文件)
- I2C 文件描述符上的 I2C 总线可写/可读标志
- 查询 NFS 上的提升进程间::file_lock
- 如何在 CompleteAsyncIO 中访问 IOMemoryBufferDescriptor,该描述符通过中断 EP
- Qt JSON – 从子项查询
- 在 c++ 中解决段树以外的范围查询的有效方法是什么?
- 无法从 Win10 中的 IDirectDraw7 查询 IDirect3D7
- rpm -q -> 仅查询描述符