亚洲欧洲国产欧美一区精品,激情五月亚洲色五月,最新精品国偷自产在线婷婷,欧美婷婷丁香五月天社区

      考試首頁 | 考試用書 | 培訓課程 | 模擬考場 | 考試論壇  
        當前位置:Linux認證 > 紅帽認證 > 紅帽認證輔導 > 文章內容
        

      RHCE7認證學習筆記:壓縮、歸檔和系統(tǒng)間的文件傳輸

      來源:Linux社區(qū) [ 2016年2月20日 ] 【

      一、歸檔和壓縮
          歸檔:archive

          tar命令歸檔的常用選項:

      [root@linuxidc ~]# tar --helpExamples:
        tar -cf archive.tar foo bar  # Create archive.tar from files foo and bar.
        tar -tvf archive.tar        # List all files in archive.tar verbosely. 列出歸檔文件中的文件
        tar -xf archive.tar          # Extract all files from archive.tar.
       Main operation mode:
        -A, --catenate, --concatenate  append tar files to an archive 追加文件到一個歸檔文件
        -c, --create              create a new archive    創(chuàng)建一個歸檔文件
        -r, --append              append files to the end of an archive 將文件追加到歸檔文件的結尾   
        -t, --list                list the contents of an archive 列出歸檔文件的內容
        -u, --update              only append files newer than copy in archive 只歸檔比歸檔文件更新的文件
        -x, --extract, --get      extract files from an archive 解壓歸檔文件
       -C, --directory=DIR        change to directory DIR 制定歸檔或解歸檔的路徑
        --remove-files        remove files after adding them to the archive 歸檔完成之后刪除原文件

       
          壓縮:compress

          tar命令壓縮的常用選項:
       Compression options:
                                  filter through PROG (must accept -d)
        -j, --bzip2                filter the archive through bzip2
        -J, --xz                  filter the archive through xz
        -z, --gzip, --gunzip, --ungzip  filter the archive through gzip
        -Z, --compress, --uncompress  filter the archive through compress

      [root@linuxidc tmp]# tar jcvf aa.bz2 aa

      [root@linuxidc tmp]# tar zcvf aa.gz aa

      [root@linuxidc tmp]# tar jxvf aa.bz2 /opt/

      [root@linuxidc tmp]# tar zxvf aa.gz /opt/

          cpio命令歸檔壓縮rpm安裝文件

          cpio的常用選項:

      [root@linuxidc tmp]# cpio --help
      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

          rpm安裝包的本質是一個壓縮包,安裝rpm包相當于將壓縮的文件解壓縮到對應的文件夾:

      [root@linuxidc xx]# rpm2cpio ../vsftpd-3.0.2-9.el7.x86_64.rpm |cpio -id
      707 blocks
      [root@linuxidc xx]# ls
      etc  usr  var  xx1  xx2

      首頁 1 2 尾頁
      將考試網(wǎng)添加到收藏夾 | 每次上網(wǎng)自動訪問考試網(wǎng) | 復制本頁地址,傳給QQ/MSN上的好友 | 申請鏈接 | 意見留言 TOP
      關于本站  網(wǎng)站聲明  廣告服務  聯(lián)系方式  站內導航  考試論壇
      Copyright © 2007-2013 中華考試網(wǎng)(Examw.com) All Rights Reserved