Uncompress & compress archive files

Extract a zip file:
unzip file.zip

Extract a tar file:
tar -xvf abrao.tar

Extract a .tar.gz (gzip) file:
tar -xzvf abrao.tar.gz

Extract a .tar.bz2 (bzip2) file:
tar -xjvf abrao.tar.bz2

  • -x : Extract a tar ball.
  • -v : Verbose output or show progress while extracting files.
  • -f : Specify an archive or a tarball filename.
  • -j : Decompress and extract the contents of the compressed archive created by bzip2 program (tar.bz2 extension).
  • -z : Decompress and extract the contents of the compressed archive created by gzip program (tar.gz extension).

To create a .zip file:
zip abrao.zip abrao

To create a .tar file:
tar -cvf abrao.tar abrao

To create a .gz file:
 tar -czvf abrao.gz abrao

To create a. tar.gz file:
tar -czvf abrao.tar.gz abrao

To create a .bz2 abrao:
tar -cjvf abrao.bz2 abrao

To create a .tar.bz2 file:
tar -cjvf abrao.tar.bz2 abrao

archives

This entry was posted in LINUX. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s