IT 1100 : Introduction to Operating Systems

Chapter 18

Archival and Backup

Compressing files:

  • Why?
  • How can a file be compressed?

Compression howto

  • gzip
  • gzip foo.txt
  • gunzip foo.txt
  • ls -l /etc | gzip > foo.txt.gz
  • zcat also allows us to see content of compressed files (whereas cat does not)

Compression howto (again)

  • bzip2
    • different compression algorithm
    • bzip2 foo.txt
    • bunzip2 foo.txt

Archival

  • Archiving
    • this is different than compression
    • tar is the classic tool for archiving files
      • tar -cvvf foo.tar files_to_tar #creates
      • tar -xvvf foo.tar #extracts
      • tar -cvzf foo.tar files_to_tar #creates and compresses (gzip)

Zip

  • Does both archival and compression
  • Similar to windows zip program.
    • zip -r foo.zip foo #recursively do this
    • unzip

Rsync

The chapter mentions this and it is important, but we will stick with scp for a while. If you want to know how to use rsync, read the chapter ;-)