Go Back   TechArena Community > Software > Tips & Tweaks
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



File Compression and Archiving in Linux

Tips & Tweaks


Reply
 
Thread Tools Search this Thread
  #1  
Old 30-12-2010
Member
 
Join Date: Jul 2010
Posts: 142
File Compression and Archiving in Linux
  

Under DOS you use the ZIP, which is both an archive and a compressor. Under Linux we have two separate programs that perform the function separately archiver and compressor. The most widely used today is the archiver tar, the name is a play on words: it is an acronym for tape archiver (that is, its original function was to store files and directories to tape). The tar archive files and directories in a single file, but it compresses them. Now let's see the syntax to save a few hours in the manual. To list the contents of a file.tar:
tar tf file.tar
Where t stands for (a produce) table of contents and f specifies that the input of the tar is file.tar (default it is usually the standard input or a device, but not a file). With v (verbose) will show more detail; tvf should always write with the t (command) first, the v (switch) in the middle and the f last. Similarly, to unpack a file.tar necessary to use:
tar xf file.tar
where x stands for extract, f is as before and if you want details on what is done, you can also add a V in the middle. Finally, we examine the creation of archives:
tar cf file.tar directory

Reply With Quote
  #2  
Old 30-12-2010
Member
 
Join Date: Jul 2010
Posts: 142
Re: File Compression and Archiving in Linux

In this way the directory is stored in file.tar. Keep in mind that when you specify a directory, the tar file the directory and all subdirectories. Now look at compression. The traditional control compression of Linux is compress which compresses a file, usually a tar archive (though not necessarily). So if I write
compress file.tar
I find myself in a directory file.tar.Z which is the compressed version of file.tar. To decompress using the uncompress command, which performs the opposite operation. However, it is widely used in practice it works the same way that gzip compresses but almost double. Gzip, however, is only a compressor, and has nothing to do with who is a pkzip archive (apart from the fact that the algorithm used is one of those of pkzip). Running gzip file.tar file.tar.gz you get a compressed file and decompress with gunzip command. These two commands are used on Linux instead of compress and uncompress, and are common on almost all Linux systems, by virtue of the fact that they are free and better (more compact and faster). Among other things, you can directly use it along with the GNU gzip tar (System on Linux) using the switch z.

Ultimately, on Linux, you can sort, compress and decompress in one fell swoop the file.tar.gz (Linux equivalent of getting a Zip: archiver and compressor) with:
tar tzf file.tar.gz
tar xzf file.tar.gz
tar czf file.tar.gz directory
This article is a summary of basic information you need to have when working with Linux. The aim was to present the essentials to get started with Linux (and Ubuntu). However, to fully exploit the power of Linux is necessary to occasionally look at the manual to discover that there are several commands, each command has many switches that can be helpful.
Reply With Quote
Reply

  TechArena Community > Software > Tips & Tweaks
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "File Compression and Archiving in Linux"
Thread Thread Starter Forum Replies Last Post
Which is the most powerful file compression tool coolio Windows Software 10 18-07-2012 06:57 PM
File compression software for mac Juaquine Windows Software 5 15-03-2010 05:07 PM
Powerpoint file compression devrish Windows Software 3 23-09-2009 12:49 PM


All times are GMT +5.5. The time now is 03:01 PM.