Linux Essentials 2.0 & 2.21 | Archiving and Compression Module 9 | Chapter 09 Exam Answers Full 100%

  1. Compression of a file works by:

    • Storing most of the data on removable media and just leaving a pointer
    • Consolidating multiple files into one
    • Eliminating gaps within the file
    • Removing the high order bit from each byte
    • Removing redundant information
  2. In general, for which of the following would you want to use lossless compression?

    • An mp3 audio file
    • A log file
    • A movie
    • A JPEG image
    • An encrypted email
  3. Lossy compression:

    (choose three)

    • Is often used with documents
    • Usually results better compression than lossless
    • Is often used with images
    • Sacrifices some quality
    • Decompresses to an identical version as the original
  4. You type gzip myfile.tar. What happens?

    (choose two)

    • myfile.tar is unarchived into the current directory
    • myfile.tar is removed
    • myfile.tar.gz holds a compressed version of myfile.tar
    • An error; you forgot to specify the file with -f
    • An error; you forgot to pass the name of the output file
  5. How would you obtain output similar to the following?
    compressed uncompressed ratio uncompressed_nam

    278168  1016950  72.6%  tags

    • gunzip –t tags
    • file tags
    • >gzip –l tags
  6. Which command would you use to archive the Documents directory and compress it with bzip2 compression?

    • tar –cjf Documents
    • tar –fzc Documents documents.tbz
    • tar –czf documents.tbz
    • tar –cf Documents documents.tbz
    • tar –cjf documents.tbz Documents
  7. Which flag would you pass to tar in order to have it make a new archive?

    • -n
    • -t
    • -x
    • -j
    • -c
  8. Which command will show what is inside the compressed tarball with a name of foo.tar.gz?

    • tar –tzf foo.tar.gz
    • tar –tf foo.tar.gz
    • tar –tjf foo.tar.gz
    • tar –lf foo.tar.gz
    • tar –xf foo.tar.gz
  9. In the command tar-cvjf foo.tbz a b c, what are a, b, and c?

    • Matching operators; anything starting with a, b, or c will be added
    • Nothing; –cvjf only expects one parameter
    • Extra flags passed to tar
    • File names to be added to the archive
    • a is the directory that will be prepended to files; b and c are files inside it
  10. Given the command tar –cvjf homedirs.tbz /home, which of the following are true?

    (choose two)

    • The /home directory will be restored with the contents of homedirs.tbz
    • The output file will be compressed
    • Only files starting with /home will be extracted from the archive
    • Files that are present in the archive might overwrite files in /home
    • The command will print out each filename as it is processed
  11. You archived your users’ directories into a file called backup.tar.gz. You then view the archive and see the filenames follow this convention:


    How will you extract just the files for the user called fred?

    •  tar –tjf backup.tar.gz /home/fred
    • tar –xjf backup.tar.gz home/fred/
    • tar –tzf /home/fred < backup.tar.gz
    • tar –xzf backup.tar.gz fred
    •  tar –xzf backup.tar.gz home/fred/
  12. Which of the following commands will create a zipfile with the contents of your Documents directory?

    • zip –c Documents
    • zip Documents
    • zip –f Documents
    • zip -cf Documents
    • zip -r Documents
  13. Given a file called, how can you see what’s in it without extracting the files?

    • unzip -l
    • zip -lf
    • showzip
    • unzip --list
    • zip -l
  14. Given a file called, how can you extract just the files under ProjectX?

    • unzip Project
    • unzip ProjectX/*
    • zip -x ProjectX
    • unzip | grep ProjectX
    • unzip -t ProjectX
  15. You try to compress a file that is already compressed. Which of the following statements is true?

    • The file will actually be uncompressed
    • The compression algorithm needs to be set to the “currently compressed” mode for it to be compressed further
    • The file will not be compressed any further than it already was
    • The file changed while you were compressing it
    • The file will be deleted
  16. Which of the following commands can be used to compress a file?

    (choose three)

    • cat
    • zip
    • bunzip2
    • gzip
    • bzip2
  17. The three main modes of tar are:

    (choose three)

    • Create
    • Copy
    • Extract
    • Compress
    • List
  18. In the command tar -czf foo.tar.gz bar, what is the purpose of the f flag?

    • Tells tar to copy only files, and not directories
    • Tells tar to write to the file that follows the flag
    • Tells tar to read from the file that follows the flag
    • Tells tar to print the name of each file as it is processed
    • Specifies extra compression is to be used
  19. Which two commands do the same thing?

    (choose two)

    • tar -czf foo.tar.gz foo
    • tar -c foo | gzip > foo.tar.gz
    • tar -x foo | gzip
    • tar -tzf foo.tar.gz
    • tar -xzf foo.tar.gz
  20. Which two programs use the Lempel-Ziv-Markov chain algorithm?

    (choose two)

    • bzip
    • lossless
    • gzip
    • lossy
    • xz
  21. By default, the zip command replaces uncompressed files with compressed files.

    True or False?

    • True
    • False
0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments