查看rpm文件中的内容

Use following syntax to list the files for already INSTALLED package:
rpm -ql package-name

Use following syntax to list the files for RPM package:
rpm -qlp package.rpm


解压缩rpm文件

以mysql-community-common-5.6.28-2.el7.x86_64.rpm为例:

  1. rpm2cpio mysql-community-common-5.6.28-2.el7.x86_64.rpm | cpio -idmv

[root@localhost mysqlRpm]# rpm2cpio mysql-community-common-5.6.28-2.el7.x86_64.rpm | cpio -idmv
./usr/share/doc/mysql-community-common-5.6.28
./usr/share/doc/mysql-community-common-5.6.28/COPYING
./usr/share/doc/mysql-community-common-5.6.28/README
./usr/share/mysql/bulgarian
./usr/share/mysql/bulgarian/errmsg.sys
./usr/share/mysql/charsets
./usr/share/mysql/charsets/Index.xml
./usr/share/mysql/charsets/README
./usr/share/mysql/charsets/armscii8.xml
./usr/share/mysql/charsets/ascii.xml
./usr/share/mysql/charsets/cp1250.xml
./usr/share/mysql/charsets/cp1251.xml
./usr/share/mysql/charsets/cp1256.xml
./usr/share/mysql/charsets/cp1257.xml
./usr/share/mysql/charsets/cp850.xml
./usr/share/mysql/charsets/cp852.xml
./usr/share/mysql/charsets/cp866.xml
./usr/share/mysql/charsets/dec8.xml
./usr/share/mysql/charsets/geostd8.xml
./usr/share/mysql/charsets/greek.xml
./usr/share/mysql/charsets/hebrew.xml
./usr/share/mysql/charsets/hp8.xml
./usr/share/mysql/charsets/keybcs2.xml
./usr/share/mysql/charsets/koi8r.xml
./usr/share/mysql/charsets/koi8u.xml
./usr/share/mysql/charsets/latin1.xml
./usr/share/mysql/charsets/latin2.xml
./usr/share/mysql/charsets/latin5.xml
./usr/share/mysql/charsets/latin7.xml
./usr/share/mysql/charsets/macce.xml
./usr/share/mysql/charsets/macroman.xml
./usr/share/mysql/charsets/swe7.xml
./usr/share/mysql/czech
./usr/share/mysql/czech/errmsg.sys
./usr/share/mysql/danish
./usr/share/mysql/danish/errmsg.sys
./usr/share/mysql/dutch
./usr/share/mysql/dutch/errmsg.sys
./usr/share/mysql/english
./usr/share/mysql/english/errmsg.sys
./usr/share/mysql/errmsg-utf8.txt
./usr/share/mysql/estonian
./usr/share/mysql/estonian/errmsg.sys
./usr/share/mysql/french
./usr/share/mysql/french/errmsg.sys
./usr/share/mysql/german
./usr/share/mysql/german/errmsg.sys
./usr/share/mysql/greek
./usr/share/mysql/greek/errmsg.sys
./usr/share/mysql/hungarian
./usr/share/mysql/hungarian/errmsg.sys
./usr/share/mysql/italian
./usr/share/mysql/italian/errmsg.sys
./usr/share/mysql/japanese
./usr/share/mysql/japanese/errmsg.sys
./usr/share/mysql/korean
./usr/share/mysql/korean/errmsg.sys
./usr/share/mysql/norwegian
./usr/share/mysql/norwegian-ny
./usr/share/mysql/norwegian-ny/errmsg.sys
./usr/share/mysql/norwegian/errmsg.sys
./usr/share/mysql/polish
./usr/share/mysql/polish/errmsg.sys
./usr/share/mysql/portuguese
./usr/share/mysql/portuguese/errmsg.sys
./usr/share/mysql/romanian
./usr/share/mysql/romanian/errmsg.sys
./usr/share/mysql/russian
./usr/share/mysql/russian/errmsg.sys
./usr/share/mysql/serbian
./usr/share/mysql/serbian/errmsg.sys
./usr/share/mysql/slovak
./usr/share/mysql/slovak/errmsg.sys
./usr/share/mysql/spanish
./usr/share/mysql/spanish/errmsg.sys
./usr/share/mysql/swedish
./usr/share/mysql/swedish/errmsg.sys
./usr/share/mysql/ukrainian
./usr/share/mysql/ukrainian/errmsg.sys
4354 blocks
[root@localhost mysqlRpm]# clr
[root@localhost mysqlRpm]# ll
total 2336
drwxr-xr-x. 3 root root    4096 Feb  3 20:51 .
dr-xr-x---. 4 root root    4096 Feb  3 20:47 ..
-rw-r--r--. 1 root root  262280 Feb  3 20:50 mysql-community-common-5.6.28-2.el7.x86_64.rpm
-rw-r--r--. 1 root root 2115880 Feb  3 20:50 mysql-community-libs-5.6.28-2.el7.x86_64.rpm
drwxr-xr-x. 3 root root      18 Feb  3 20:51 usr(解压缩之后生成的)

 



【linux】如何查看和解压缩rpm文件内容的更多相关文章

  1. 【转】Linux 中清空或删除大文件内容的五种方法(truncate 命令清空文件)

    原文: http://www.jb51.net/article/100462.htm truncate -s 0 access.log -------------------------------- ...

  2. od 查看特殊格式的文件内容

    用户通常使用od命令查看特殊格式的文件内容.通过指定该命令的不同选项可以以十进制.八进制.十六进制和ASCII码来显示文件. 语法: od [选项] 文件- 命令中各选项的含义: - A 指定地址基数 ...

  3. Linux数据归档和解压缩tar,cpio,gzip,bzip,lzma,zip命令使用

    转载:http://www.1987.name/659.html 数据压缩归档和备份是系统管理的日常工作,定期备份不可小视,归档和压缩对于系统管理员或是普通用户来说都经常用到的操作,有很多中压缩格式, ...

  4. linux 下 打包 和解压缩

    01-.tar格式解包:[*******]$ tar xvf FileName.tar打包:[*******]$ tar cvf FileName.tar DirName(注:tar是打包,不是压缩! ...

  5. linux(centos8):用grep命令查找文件内容

    一,grep的用途: linux平台有最常用的三大文本处理工具:awk/sed/grep grep的功能:搜索指定文件的内容,按照指定的模式匹配,并输出匹配内容所在的行. 需要注意的地方:grep只支 ...

  6. Linux基础知识第四讲,文件内容命令

    目录 一丶常用命令 1.cat命令演示以及常用选项 2.grep 搜索命令的使用 3.echo 以及 重定向的使用 4.管道概念 一丶常用命令 序号 命令 对应英文 作用 01 cat 文件名 con ...

  7. Linux下vim基本操作和清空文件内容的常用方法

    以前都是用的很土的办法,大概有以下几种.1.直接删除,创建一个新的同名文件(这种方法的弊端是有可能这个文件带着权限或者是属性,那么你新建这个文件后有可能会导致权限不正确或者丢失属性).2.使用vim编 ...

  8. [译]在Linux中清空或删除大文件内容的5种方法

    原文来源: https://www.tecmint.com/empty-delete-file-content-linux/ 有时,在处理Linux终端中的文件时,您可能希望清除文件的内容,而无需使用 ...

  9. Linux 下清空或删除大文件内容的 5 种方法

    在 Linux 终端下处理文件时,有时我们想直接清空文件的内容但又不必使用任何 Linux 命令行编辑器 去打开这些文件.那怎样才能达到这个目的呢?在这篇文章中,我们将介绍几种借助一些实用的命令来清空 ...

随机推荐

  1. PostgreSQL增删数据命令示例

    在PostgreSQL中如何用简单的几条SQL语句生成大量的测试数据呢? 此处,我简单的写一个例子,供参考(在Postgresql9.1下面做的): (1)生成一万条测试数据的表foo mydb=# ...

  2. console下纯字符实现的贪吃蛇

    最近简直超级无聊-- code blocks win7 64编译运行无问题,应该其他编译器也不会有问题. w:上 s:下 a:左 d:右 CS标准方向控制,AK47和M4这种高级货是没有滴-- 废话不 ...

  3. uploadify上传

     一.上传按钮样式 1.1id="show_filebutton"是显示给用户操作按钮,id="filebutton"是flash上传按钮完成用户上传操作.id ...

  4. 使用swiper和吸顶效果代码

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...

  5. Python中strip()函数

    在python API中这样解释strip()函数:

  6. Phython 学习笔记之——类的初步认识

    类是面向对象编程的核心,他扮演相关数据及逻辑容器的角色.他们提供了创建实例对象的蓝图.因为python语言不要求必须以面向对象的方式编程(与JAVA不同),这里简单的举一个例子. 如何定义一个类 cl ...

  7. Share Point 创建 TimerJob

    public class SyncMetadataJob:SPJobDefinition { private const string JobName = @"Metadata Sync J ...

  8. cacti

    http://www.cacti.net/downloads/docs/html/index.html Cacti脚本及模板论坛:http://forums.cacti.net/forum-12.ht ...

  9. Response.Redirect在新窗口打开网页

    来自:http://www.woosky.net/show.asp?id=761 Respose.Write("<script language='javascript'>win ...

  10. P1001 第K极值【tyvj】

    /*========================================== P1001 第K极值 内存限制 128MB 代码限制 64KB 描述 Description 给定一个长度为N ...