解压cpio文件

cpio命令用于解压 .cpio文件,下面我们来看下cpio的用法

解压cpio文件 cpio -idmv < filename.cpio
同样可以解压img文件:cpio -idmv < filename.imgcpio
备份命令备份:cpio -covB > [file|device]
将数据备份到文件或设备上还原:cpio -icduv < [file|device}
将数据还原到系统中常用参数:-o   :将数据copy到文件或设备上
-i    :将数据从文件或设备上还原到系统中
-t    :查看cpio建立的文件或设备内容
-c   :一种比较新的portable format方式存储
-v   :在屏幕上显示备份过程中的文件名
-B   :让预设的blocks可以增加到5120bytes,默认是512bytes,这样可以使备份速度加快
-d   :自动建立目录,这样还原时才不会出现找不到路径的问题
-u   :更新,用较新的文件覆盖旧的文件cpio常与find 配合使用

oracle用的是这种归档,只好记录一下了。

#gunzip 文件名.cpio.gz

#cpio -idmv < 文件名.cpio

# cpio -idvm < aix_oracle817_32_Disk1.cpio

 

cpio: 0511-903 Out of phase!

         cpio attempting to continue...


cpio: 0511-904 skipping 124796 bytes to get back in phase!

         One or more files lost and the previous file is possibly corrupt!

cpio: 0511-027 The file name length does not match the expected value.

# man cpio

c Reads and writes header information in ASCII character form. If a cpio archive

was created using the c flag, it must be extracted with c flag.


加上参数c就OK了

cpio -idvmc < aix_oracle817_32_Disk1.cpio


下面是cpio的用法帮助

# cpio --help
Usage: cpio [OPTION...] [destination-directory]
GNU `cpio' copies files to and from archives


Examples:
  # Copy files named in name-list to the archive
  cpio -o < name-list [> archive]
  # Extract files from the archive
  cpio -i [< archive]
  # Copy files named in name-list to destination-directory
  cpio -p destination-directory < name-list


 Main operation mode:
  -i, --extract              Extract files from an archive (run in copy-in
                             mode)
  -o, --create               Create the archive (run in copy-out mode)
  -p, --pass-through         Run in copy-pass mode
  -t, --list                 Print a table of contents of the input


 Operation modifiers valid in any mode:


      --block-size=BLOCK-SIZE   Set the I/O block size to BLOCK-SIZE * 512
                             bytes
  -B                         Set the I/O block size to 5120 bytes
  -c                         Identical to "-H newc", use the new (SVR4)
                             portable format.If you wish the old portable
                             (ASCII) archive format, use "-H odc" instead.
  -C, --io-size=NUMBER       Set the I/O block size to the given NUMBER of
                             bytes
      --force-local          Archive file is local, even if its name contains
                             colons
  -f, --nonmatching          Only copy files that do not match any of the given
                             patterns
  -F, --file=[[USER@]HOST:]FILE-NAME
                             Use this FILE-NAME instead of standard input or
                             output. Optional USER and HOST specify the user
                             and host names in case of a remote archive
  -H, --format=FORMAT        Use given archive FORMAT
  -M, --message=STRING       Print STRING when the end of a volume of the
                             backup media is reached
  -n, --numeric-uid-gid      In the verbose table of contents listing, show
                             numeric UID and GID
      --quiet                Do not print the number of blocks copied
      --rsh-command=COMMAND  Use remote COMMAND instead of rsh
  -v, --verbose              Verbosely list the files processed
  -V, --dot                  Print a "." for each file processed
  -W, --warning=FLAG         Control warning display. Currently FLAG is one of
                             'none', 'truncate', 'all'. Multiple options
                             accumulate.


 Operation modifiers valid only in copy-in mode:


      --absolute-filenames   do not strip leading file name components that
                             contain ".." and leading slashes from file names
  -b, --swap                 Swap both halfwords of words and bytes of
                             halfwords in the data. Equivalent to -sS
  -E, --pattern-file=FILE    In copy-in mode, read additional patterns
                             specifying filenames to extract or list from FILE
      --no-absolute-filenames   Create all files relative to the current
                             directory
      --only-verify-crc      When reading a CRC format archive in copy-in mode,
                             only verify the CRC's of each file in the archive,
                             don't actually extract the files
  -r, --rename               Interactively rename files
  -s, --swap-bytes           Swap the bytes of each halfword in the files
  -S, --swap-halfwords       Swap the halfwords of each word (4 bytes) in the
                             files
      --to-stdout            Extract files to standard output


 Operation modifiers valid only in copy-out mode:


  -A, --append               Append to an existing archive.
  -O [[USER@]HOST:]FILE-NAME Archive filename to use instead of standard
                             output. Optional USER and HOST specify the user
                             and host names in case of a remote archive


 Operation modifiers valid only in copy-pass mode:


  -l, --link                 Link files instead of copying them, when
                             possible


 Operation modifiers valid for copy-out and copy-pass modes:


  -0, --null                 A list of filenames is terminated by a null
                             character instead of a newline
  -a, --reset-access-time    Reset the access times of files after reading
                             them
  -I [[USER@]HOST:]FILE-NAME Archive filename to use instead of standard input.
                             Optional USER and HOST specify the user and host
                             names in case of a remote archive
  -L, --dereference          Dereference  symbolic  links  (copy  the files
                             that they point to instead of copying the links).
  -R, --owner=[USER][:.][GROUP]   Set the ownership of all files created to the
                             specified USER and/or GROUP
      --sparse               Write files with large blocks of zeros as sparse
                             files


 Operation modifiers valid for copy-in and copy-pass modes:


  -d, --make-directories     Create leading directories where needed
  -m, --preserve-modification-time
                             Retain previous file modification times when
                             creating files
      --no-preserve-owner    Do not change the ownership of the files
  -u, --unconditional        Replace all files unconditionally


 Informative options:


  -?, --help                 Give this help list
      --license              Print license and exit
      --usage                Give a short usage message
      --version              Print program version


Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.


Report bugs to <bug-cpio@gnu.org>.


转载自网络

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值