Tuesday, August 3, 2010

Compressed Tar and untar in linux/unix

Most of the text available on internet tell you to "tar -cvf filename" to tar a file. And it's damn correct. But what it doesn't tell you is that TAR (TAPE ARCHIVE) is not a compression format like zip. So a tar file is not necessarily a compressed file. It's just a tape archive and has some history attached to it, which i do not care about.

WTF...!

The real command to get a compressed tar file or compressed tar.gz file is

tar -czvf tarfilename.tar.gz file1 file2 file3 ...


And to extract

tar -xzvf tarfilename.tar.gz


Huh! Ignorance is antonym of Bliss.

No comments:

Post a Comment