Lesson 3 Flashcards
How does compression work?
By replacing repetitive patterns in data. For example finding a common word and replacing it with something else then creating a map to that replacement (obv more complex)
What are the two types of compression?
Lossless and Lossy
When is lossy compression often used?
For images, video or audio where loss in the original data has a marginal effect
Name some common lossless compression tools
bzip2, gzip, xz
What is the most common archiving tool?
tar
how do you uncompress? name the common commands
bunzip2, gunzip, unxz
How can you increase or decrease the level of compression?
By using -1
through -9
…common among all compression tools
what is the syntax for a tar command to compress?
tar -cf newfile pathtoarchive
what is the syntax to untar?
tar -xf <file/path>
When using tar with gzip, bgzip2 and xz what are the commands?
gzip = tar -xzf
bzip2 = tar -xjf
xz = tar -xJf
syntax to zip recursively
zip -r filename filepath
syntax to unzip
unzip filename
how to output the contents of a compressed file?
zcat gzip, bzcat for bzip2
how do add a file to a compressed tar?
First you need to uncompress it so gunzip or bunzip2 or unxz…then use tar uf to add a new file
how to view contents of a tar without extracting it?
tar -tf filename
Which tar option instructs tar to include the leading “/” in the absolute paths?
-P
Does zip support multiple compression levels?
Yes same as the other compression tools