从rpm包中解压文件
- Listing the files in a package file
# rpm2cpio <RPM Package File>.rpm | cpio -t
In this example, we used the -t option to direct cpio to produce
a "table of contents" of the archive created by rpm2cpio.
This can make it much easier to get the right filename
and path when you want to extract a file.
[root@ealldb2 ttt]# rpm2cpio vsftpd-1.2.1-3E.6.i386.rpm |cpio -t
./etc/logrotate.d/vsftpd.log
./etc/pam.d/vsftpd
./etc/rc.d/init.d/vsftpd
./etc/vsftpd
./etc/vsftpd.ftpusers
./etc/vsftpd.user_list
./etc/vsftpd/vsftpd.conf
./usr/sbin/vsftpd
./usr/share/doc/vsftpd-1.2.1
./usr/share/doc/vsftpd-1.2.1/AUDIT
./usr/share/doc/vsftpd-1.2.1/BUGS
./usr/share/doc/vsftpd-1.2.1/Changelog
./usr/share/doc/vsftpd-1.2.1/FAQ
./usr/share/doc/vsftpd-1.2.1/INSTALL
./usr/share/doc/vsftpd-1.2.1/LICENSE
./usr/share/doc/vsftpd-1.2.1/README
./usr/share/doc/vsftpd-1.2.1/README.security
./usr/share/doc/vsftpd-1.2.1/REWARD
./usr/share/doc/vsftpd-1.2.1/SECURITY
./usr/share/doc/vsftpd-1.2.1/SECURITY/DESIGN
./usr/share/doc/vsftpd-1.2.1/SECURITY/IMPLEMENTATION
./usr/share/doc/vsftpd-1.2.1/SECURITY/OVERVIEW
./usr/share/doc/vsftpd-1.2.1/SECURITY/TRUST
./usr/share/doc/vsftpd-1.2.1/SIZE
./usr/share/doc/vsftpd-1.2.1/SPEED
./usr/share/doc/vsftpd-1.2.1/TODO
./usr/share/doc/vsftpd-1.2.1/TUNING
./usr/share/doc/vsftpd-1.2.1/vsftpd.xinetd
./usr/share/man/man5/vsftpd.conf.5.gz
./usr/share/man/man8/vsftpd.8.gz
./var/ftp
./var/ftp/pub
379 blocks
[root@ealldb2 ttt]#
- Extracting one or more files from a package file
# rpm2cpio vsftpd-1.2.1-3E.6.i386.rpm |cpio -ivd ./etc/vsftpd/vsftpd.conf
In this case, the cpio options -i, -v, and -d direct cpio to:
- Extract one or more files from an archive.
- Display the names of any files processed,
along with the size of the archive file, in 512-byte blocks. [1]
- Create any directories that precede the filename specified in the cpio command.
解出一个和全部文件的例子
[root@ealldb2 ttt]# rpm2cpio vsftpd-1.2.1-3E.6.i386.rpm |cpio -ivd ./etc/vsftpd/vsftpd.conf
./etc/vsftpd/vsftpd.conf
379 blocks
[root@ealldb2 ttt]# rpm2cpio vsftpd-1.2.1-3E.6.i386.rpm |cpio -ivd
./etc/logrotate.d/vsftpd.log
./etc/pam.d/vsftpd
./etc/rc.d/init.d/vsftpd
./etc/vsftpd
./etc/vsftpd.ftpusers
./etc/vsftpd.user_list
./etc/vsftpd/vsftpd.conf
./usr/sbin/vsftpd
./usr/share/doc/vsftpd-1.2.1
./usr/share/doc/vsftpd-1.2.1/AUDIT
./usr/share/doc/vsftpd-1.2.1/BUGS
./usr/share/doc/vsftpd-1.2.1/Changelog
./usr/share/doc/vsftpd-1.2.1/FAQ
./usr/share/doc/vsftpd-1.2.1/INSTALL
./usr/share/doc/vsftpd-1.2.1/LICENSE
./usr/share/doc/vsftpd-1.2.1/README
./usr/share/doc/vsftpd-1.2.1/README.security
./usr/share/doc/vsftpd-1.2.1/REWARD
./usr/share/doc/vsftpd-1.2.1/SECURITY
./usr/share/doc/vsftpd-1.2.1/SECURITY/DESIGN
./usr/share/doc/vsftpd-1.2.1/SECURITY/IMPLEMENTATION
./usr/share/doc/vsftpd-1.2.1/SECURITY/OVERVIEW
./usr/share/doc/vsftpd-1.2.1/SECURITY/TRUST
./usr/share/doc/vsftpd-1.2.1/SIZE
./usr/share/doc/vsftpd-1.2.1/SPEED
./usr/share/doc/vsftpd-1.2.1/TODO
./usr/share/doc/vsftpd-1.2.1/TUNING
./usr/share/doc/vsftpd-1.2.1/vsftpd.xinetd
./usr/share/man/man5/vsftpd.conf.5.gz
./usr/share/man/man8/vsftpd.8.gz
./var/ftp
./var/ftp/pub
379 blocks
[root@ealldb2 ttt]#
- Listing the files in a package file
# rpm2cpio <RPM Package File>.rpm | cpio -t
In this example, we used the -t option to direct cpio to produce
a "table of contents" of the archive created by rpm2cpio.
This can make it much easier to get the right filename
and path when you want to extract a file.
[root@ealldb2 ttt]# rpm2cpio vsftpd-1.2.1-3E.6.i386.rpm |cpio -t
./etc/logrotate.d/vsftpd.log
./etc/pam.d/vsftpd
./etc/rc.d/init.d/vsftpd
./etc/vsftpd
./etc/vsftpd.ftpusers
./etc/vsftpd.user_list
./etc/vsftpd/vsftpd.conf
./usr/sbin/vsftpd
./usr/share/doc/vsftpd-1.2.1
./usr/share/doc/vsftpd-1.2.1/AUDIT
./usr/share/doc/vsftpd-1.2.1/BUGS
./usr/share/doc/vsftpd-1.2.1/Changelog
./usr/share/doc/vsftpd-1.2.1/FAQ
./usr/share/doc/vsftpd-1.2.1/INSTALL
./usr/share/doc/vsftpd-1.2.1/LICENSE
./usr/share/doc/vsftpd-1.2.1/README
./usr/share/doc/vsftpd-1.2.1/README.security
./usr/share/doc/vsftpd-1.2.1/REWARD
./usr/share/doc/vsftpd-1.2.1/SECURITY
./usr/share/doc/vsftpd-1.2.1/SECURITY/DESIGN
./usr/share/doc/vsftpd-1.2.1/SECURITY/IMPLEMENTATION
./usr/share/doc/vsftpd-1.2.1/SECURITY/OVERVIEW
./usr/share/doc/vsftpd-1.2.1/SECURITY/TRUST
./usr/share/doc/vsftpd-1.2.1/SIZE
./usr/share/doc/vsftpd-1.2.1/SPEED
./usr/share/doc/vsftpd-1.2.1/TODO
./usr/share/doc/vsftpd-1.2.1/TUNING
./usr/share/doc/vsftpd-1.2.1/vsftpd.xinetd
./usr/share/man/man5/vsftpd.conf.5.gz
./usr/share/man/man8/vsftpd.8.gz
./var/ftp
./var/ftp/pub
379 blocks
[root@ealldb2 ttt]#
- Extracting one or more files from a package file
# rpm2cpio vsftpd-1.2.1-3E.6.i386.rpm |cpio -ivd ./etc/vsftpd/vsftpd.conf
In this case, the cpio options -i, -v, and -d direct cpio to:
- Extract one or more files from an archive.
- Display the names of any files processed,
along with the size of the archive file, in 512-byte blocks. [1]
- Create any directories that precede the filename specified in the cpio command.
解出一个和全部文件的例子
[root@ealldb2 ttt]# rpm2cpio vsftpd-1.2.1-3E.6.i386.rpm |cpio -ivd ./etc/vsftpd/vsftpd.conf
./etc/vsftpd/vsftpd.conf
379 blocks
[root@ealldb2 ttt]# rpm2cpio vsftpd-1.2.1-3E.6.i386.rpm |cpio -ivd
./etc/logrotate.d/vsftpd.log
./etc/pam.d/vsftpd
./etc/rc.d/init.d/vsftpd
./etc/vsftpd
./etc/vsftpd.ftpusers
./etc/vsftpd.user_list
./etc/vsftpd/vsftpd.conf
./usr/sbin/vsftpd
./usr/share/doc/vsftpd-1.2.1
./usr/share/doc/vsftpd-1.2.1/AUDIT
./usr/share/doc/vsftpd-1.2.1/BUGS
./usr/share/doc/vsftpd-1.2.1/Changelog
./usr/share/doc/vsftpd-1.2.1/FAQ
./usr/share/doc/vsftpd-1.2.1/INSTALL
./usr/share/doc/vsftpd-1.2.1/LICENSE
./usr/share/doc/vsftpd-1.2.1/README
./usr/share/doc/vsftpd-1.2.1/README.security
./usr/share/doc/vsftpd-1.2.1/REWARD
./usr/share/doc/vsftpd-1.2.1/SECURITY
./usr/share/doc/vsftpd-1.2.1/SECURITY/DESIGN
./usr/share/doc/vsftpd-1.2.1/SECURITY/IMPLEMENTATION
./usr/share/doc/vsftpd-1.2.1/SECURITY/OVERVIEW
./usr/share/doc/vsftpd-1.2.1/SECURITY/TRUST
./usr/share/doc/vsftpd-1.2.1/SIZE
./usr/share/doc/vsftpd-1.2.1/SPEED
./usr/share/doc/vsftpd-1.2.1/TODO
./usr/share/doc/vsftpd-1.2.1/TUNING
./usr/share/doc/vsftpd-1.2.1/vsftpd.xinetd
./usr/share/man/man5/vsftpd.conf.5.gz
./usr/share/man/man8/vsftpd.8.gz
./var/ftp
./var/ftp/pub
379 blocks
[root@ealldb2 ttt]#
在 rhel6下 新增加了 rpmdev*
# rpmdev-extract *.rpm