Question

1. gzip is a useful utility in Linux. Read the webpage below about gzip. Please tell...

1. gzip is a useful utility in Linux. Read the webpage below about gzip. Please tell the differences between gzip and tar.

https://www.rootusers.com/11-simple-gzip-examples/

0 0
Add a comment Improve this question Transcribed image text
Answer #1

GZIP vs TAR
The .tar.gz extension is a very popular one when downloading files especially in non Windows operating systems. But unlike most extensions, this is not meant to identify a single program that would be used to open this file; it points to two. Tar is a file format but is also the name of the program that produces the file. Tar is an archiver, meaning it would archive multiple files into a single file but without compression. Gzip which handles the .gz extension is the compression tool that is used to reduce the disk space used by the file.

There are advantages and disadvantages in creating a zipped tarball compared to the standard applications that does both. A zipped tarball could have dramatically reduced filesize the compression tool is not compressing the files individually but treating the whole tarball as one big file. This is even more apparent when dealing with semi compressed files like GIF and JPG files.

The disadvantage of using this format is that you would be unable to extract a single file. Since the entire archive is compressed as a whole, you would also need to uncompress the whole archive before extracting a single file. Extracting a single file from a large zipped tarball could take significantly longer compared to extracting a single file from the same files compressed and archived by a different tool like Winrar or Winzip.

Summary:
1. Gzip is a compression tool used to reduce the size of a file
2. Tar is an archiver used to to combine multiple files into one
3. Gzip and Tar are usually used in tandem to create Tarballs that are compressed significantly
4. Extracting an individual file can take a lot longer with zipped tarballs than with other formats

How to compress files using Gzip?

As a Unix admin, you can use the command “zip” and “gunzip” to compress and decompress files respectively. Here I am illustrating a simple example of the same.

Test file name is test.txt
To compress file to smaller:

# zip test.txt

After executing this command, the file size will reduce and will add the extension .gz to the file. Use the command “guzip” to decompress the file.

# gunzip test.txt.gz

How to create an archive using tar?

Create an archive using tar.

# tar -cvf archive.tar file1.txt file3.txt

Here the files file1 and file2 will combine together and formed the file archive.tar, you can use the tar command with switch -x to extract file from the archive created.

# tar -xvf archive.tar

Here we goes to the extension “.tar.gz”. Yes, there is an option in tar command to compress the files by using additional switches like “-z”, “-j” for Gzip and Bzip respectively.
Examples:
For gzip,

# tar -zcf file.tar.gz file2.txt file1.txt

For bzip,

# tar -jcf file.tar.bz file2.txt file1.txt
Add a comment
Know the answer?
Add Answer to:
1. gzip is a useful utility in Linux. Read the webpage below about gzip. Please tell...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Read the paragraph below and tell me what the structure and language of the mode of...

    Read the paragraph below and tell me what the structure and language of the mode of discourse, quoting specifically as you read. __________________________________ Another major aspect of being a parent is medical awareness. While a parent is often a professional, most parents are not medical specialists. Nevertheless, parents are required to have a degree of understanding of medications, allergies, prescriptions, dosages, side effects and specialist terms. These are but examples of what medical awareness constitutes. There are few workshops or...

  • 1 and 2 please SCHON 21.1 and read about combinations of resistors in series and parallel....

    1 and 2 please SCHON 21.1 and read about combinations of resistors in series and parallel. Pay attention to figure 21.2. look how resistors are connected, are any junctions in between them? Equations 21.5 and 21.20 are main take aways. • Warm-Up 1. A 6.082 and a 12.00 resistor are connected in series. Make a sketch below. What is the overall equivalent resistance of this combination? 2 A 609) and a 12.002 resistor are now connected in parallel Make a...

  • Write appropriate in length essay and answer the questions below. Please use details and examples. 1.   After...

    Write appropriate in length essay and answer the questions below. Please use details and examples. 1.   After seeing a terrifying news report, your boss is considering getting rid of the office Internet connection to keep hackers from getting into the company server. What can you tell your boss about safeguards you will implement to keep the server safe? 2.   A coworker complains that he is receiving a high amount of spam on his home computer through his personal e-mail account. What advice...

  • 9:43 Description X Step 1: Read about the affects of water in our body Answer the...

    9:43 Description X Step 1: Read about the affects of water in our body Answer the following for your initial post: Identify the function of water in our body. Explain the importance of water Identify the risk factors of over consuming or under consuming water Step 2: Read and Respond to two of your peers Use your personal experience, if it's relevant, to support or debate other students' posts. If differences of opinion oCcur, debate the issues professionally and provide...

  • 10:25 Description Step 1: Read about the clinical definitions of "weight" Identify the clinical concept of...

    10:25 Description Step 1: Read about the clinical definitions of "weight" Identify the clinical concept of a "healthy weight" • Identify the clinical term overweight • Identify the clinical term underweight • Identify the clinical term obese How does society's opinion of these terms differ from the clinical definition? Step 2: Read and Respond to two fo your peers • Use your personal experience, if it's relevant, to support or debate other students' posts. If differences of opinion occur, debate...

  • Please read this comment: This is the only file given by my professor and so can...

    Please read this comment: This is the only file given by my professor and so can you please help me to write a python program. You can use any test file and post the output with the code. The output might be different then above but please help me to get started with the PYTHON code. Thank you in advance You are going to write a Python program that represents a command line version of a hexadecimal editor. This program...

  • Please read this article before answering questions,"New World Order: Labor, Capital and Ideas in the Power...

    Please read this article before answering questions,"New World Order: Labor, Capital and Ideas in the Power Law Economy". Article link: https://www.philadelphiafed.org/-/media/research-and-data/events/2015/fed-policy-forum/papers/brynjolfsson-new_world_order.pdf?la=en Questions:  Must be a total of 350 words! 1. What is the relationship between globalization and technology in bringing about more innovation? 2. Why is what the authors call the "second machine age: important?

  • 1. Read about the three major theories of intelligence (Spearman’s G, Cattell and Horn’s crystallized vs...

    1. Read about the three major theories of intelligence (Spearman’s G, Cattell and Horn’s crystallized vs fluid, or Sternberg’s triarchic theory). Describe one and tell me why is it important to understand; please don’t copy straight out of the text or slides, use your own words. 2. How schemas and heuristics are connected to cognitive fallacies? Thanks!

  • Step 1: Read about sugars Write a one page paper explaining the differences between natural sugars...

    Step 1: Read about sugars Write a one page paper explaining the differences between natural sugars and added sugars Step 2: Choose 5 foods items with food labels List the ingredients Find ALL of the added sugars hidden in the ingredient list and highlight them You may include pictures of the food labels

  • 1. Tell us about a specific, genetically controlled trait in an organism of interest and describe...

    1. Tell us about a specific, genetically controlled trait in an organism of interest and describe the importance of this trait. 2. USE either Google scholar or Pubmed in NCBI to find a research article that reveals the official name of a gene that geneticists have discovered that controls this trait. 3. Search the Nucleotide database in NCBI (link below) using the gene name. Share with us the size of the protein the gene encodes. 4. Conduct a primer pair...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT