Archiving Files

Key Goals

  • Learn abount archiving and compressing files

Section Objectives

  • tar
  • gzip & gunzip
  • bzip2 & bunzip2

Traning questions

tar, gzip & gunzip, bzip2 & bunzip2

  1. Questions:
    1. What can you do with tar but can’t do with gzip?
  2. Scenario:
    1. Backup your home directory content to the /tmp/backup_user.tar (use tar).
    2. Use du (disk usage) to examine the size of your backup file.
    3. Use du to calculate the sum of the actual files located inside your home directory.
    4. How much space did the compressing process save you and how much time did it take (use the time command)?
    5. Extract the /tmp/backup_user.tar file to the /opt/tempdir directory.
    6. remove /opt/tempdir directory.
    7. Use gzip to compress /tmp/backup_user.tar
    8. How much space did the compressing process save you and how much time did it take (use the time command)?
    9. Unzip the file to tar again.
    10. Use bzip2 to compress /tmp/backup_user.tar
    11. How much space did the compressing process save you and how much time did it take (use the time command)?
    12. Unzip the file to tar again.