Chapter 9 Exam Flashcards

1
Q

Compression of a file works by:

Eliminating gaps within the file

Consolidating multiple files into one

Removing redundant information

Storing most of the data on removable
media and just leaving a pointer

Removing the high order bit from each byte

A

Removing redundant information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In general, for which of the following would you want to use lossless compression?

An mp3 audio file
An encrypted email
A JPEG image
A log file
A movie
A

A log file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Lossy compression:
(choose three)

Usually results better compression than lossless

Is often used with images

Is often used with documents

Decompresses to an identical version as the original

Sacrifices some quality

A

Usually results better compression than lossless

Is often used with images

Sacrifices some quality

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

You type gzip myfile.tar. What happens?
(choose two)

myfile.tar is unarchived into the current directory

An error; you forgot to pass the name of the output file

myfile.tar.gz holds a compressed version of myfile.tar

An error; you forgot to specify the file with -f

myfile.tar is removed

A

myfile. tar.gz holds a compressed version of myfile.tar

myfile. tar is removed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How would you obtain output similar to the following?

compressed uncompressed ratio uncompressed_name

278168 1016950 72.6% tags

gzip –l tags
gunzip –t tags
file tags

A

gzip –l tags

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which command would you use to archive the Documents directory and compress it with bzip2 compression?

tar –fzc Documents documents.tbz
tar –cf Documents documents.tbz
tar –cjf Documents
tar –cjf documents.tbz Documents
tar –czf documents.tbz
A

tar –cjf documents.tbz Documents

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which flag would you pass to tar in order to have it make a new archive?

  • t
  • c
  • n
  • x
  • j
A

-c

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which command will show what is inside the compressed tarball with a name of foo.tar.gz?

tar –tjf foo.tar.gz
tar –lf foo.tar.gz
tar –tf foo.tar.gz
tar –xf foo.tar.gz
tar –tzf foo.tar.gz
A

tar –tzf foo.tar.gz

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In the command tar -cvjf foo.tbz a b c, what are a, b, and c?

Nothing; -cvjf only expects one parameter

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

Matching operators; anything starting with a, b, or c will be added

Extra flags passed to tar

A

File names to be added to the archive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Given the command tar –cvjf homedirs.tbz /home, which of the following are true?
(choose two)

Only files starting with /home will be extracted from the archive

The command will print out each filename as it is processed

The /home directory will be restored with the contents of homedirs.tbz

Files that are present in the archive might overwrite files in /home

The output file will be compressed

A

The command will print out each filename as it is processed

The output file will be compressed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

You archived your users’ directories into a file called backup.tar.gz. You then view the archive and see the filenames follow this convention:

home/username/somefile

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

tar –xzf backup.tar.gz home/fred/
tar –tjf backup.tar.gz /home/fred
tar –xjf backup.tar.gz home/fred/
tar –xzf backup.tar.gz fred
tar –tzf /home/fred < backup.tar.g
A

tar –xzf backup.tar.gz home/fred/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of the following commands will create a zipfile with the contents of your Documents directory?

zip –f mydocs.zip Documents
zip -r mydocs.zip Documents
zip –c mydocs.zip Documents
zip mydocs.zip Documents
zip -cf mydocs.zip Documents
A

zip -r mydocs.zip Documents

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Given a file called documents.zip, how can you see what’s in it without extracting the files?

zip -lf documents.zip
unzip -l documents.zip
unzip –list documents.zip
zip -l documents.zip
showzip documents.zip
A

unzip -l documents.zip

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Given a file called documents.zip, how can you extract just the files under ProjectX?

unzip documents.zip ProjectX/*
unzip documents.zip | grep ProjectX
unzip documents.zip ProjectX
zip -x documents.zip ProjectX
unzip -t documents.zip ProjectX
A

unzip documents.zip ProjectX/*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

You try to compress a file that is already compressed. Which of the following statements is true?

The file will not be compressed any further than it already was

The compression algorithm needs to be set to the “currently compressed” mode for it to be compressed further

The file changed while you were compressing it

The file will be deleted

The file will actually be uncompressed

A

The file will not be compressed any further than it already was

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which of the following commands can be used to compress a file?
(choose three)

bunzip2
cat
zip
bzip2
gzip
A

zip
bzip2
gzip

17
Q

The three main modes of tar are:
(choose three)

List
Create
Compress
Copy
Extract
A

List
Create
Extract

18
Q

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 read from the file that follows the flag

Tells tar to write to 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

A

Tells tar to write to the file that follows the flag

19
Q

Which two commands do the same thing?
(choose two)

tar -czf foo.tar.gz foo
tar -tzf foo.tar.gz
tar -c foo | gzip > foo.tar.gz
tar -x foo | gzip
tar -xzf foo.tar.gz
A

tar -czf foo.tar.gz foo

tar -c foo | gzip > foo.tar.gz

20
Q

Which two programs use the Lempel-Ziv-Markov chain algorithm?
(choose two)

xz
lossless
lossy
bzip
gzip
A

xz

gzip

21
Q

By default, the zip command replaces uncompressed files with compressed files.
True or False?
True
False

A

True