By using this site, you agree to the Privacy Policy, Cookie Policy and Terms of Service.
Accept
TRENDING
  • Linux
  • Shell Script
  • Cloud
  • DevOps
  • About US
SUBSCRIBE
  • CLOUD
  • DEVOPS
  • LINUX
  • SHELL SCRIPT
Reading: How to Extract tar.gz / tar.bz2 / tar.xz Files on Linux
Share
TechBrownTechBrown
Aa
  • CLOUD
  • DEVOPS
  • LINUX
  • SHELL SCRIPT
Search
  • CLOUD
  • DEVOPS
  • LINUX
  • SHELL SCRIPT
Follow US
© 2014 - 2022 TechBrown. All Rights Reserved.
Linux

How to Extract tar.gz / tar.bz2 / tar.xz Files on Linux

Published March 15, 2017
Share
3 Min Read
SHARE

The TAR command is create in Linux for archiving backup data to a Tape drive. The commands has large amount of advantage. The Linux system admins is using for Backup and restoring purposes. The tarballs are most popular method to archiving data into tar files including various extensions like tar.gz / tar.xz / tar.bz2 etc.

It is developed to achieve data with robust tar ball files. This is most widely used Linux commands for most probably used for the backup. When any backup is archiving with this method then question arises here how to exact the tar balls. This tutorial show how extract those tar ball files.

Syntax of command

First of all These are given syntax is recommend only for tar command.

tar.gz

$ tar -recommended-options filename.tar.gz -optional-options

tar.bz2

$ tar -recommended-options filename.tar.bz2 -optional-options

tar.xz

$ tar -recommended-options filename.tar.xz -optional-options

Options

Secondly the Recommended Options are:

  • –x : Extract
  • –v : Verbose Mode
  • –f : File Name
  • –z : Decompress for tar.gz file only
  • –j : Decompress for tar.bz2 file only
  • –J : Decompress for tar.xz file only

Finally the Optional Options are

  • –C : Followed by the Path of Destination Directory

Extract Files in Same Current Directory

Secondly the file extraction process should followed by the same directory.

tar.gz

$ tar -xzvf techbrown.tar.gz

tar.bz2

$ tar -xjvf techbrown.tar.bz2

tar.xz

$ tar -xJvf techbrown.tar.xz

Extract Files in Particular Destination Directory

First of all Extracting files from the tarball. The extraction of tarball can be done using command.

After that Tar ball mainly utilized for the archive of backups.

Finally to get back files that are in compressed state roll backing to its original part is know as extract the tarballs.

tar.gz

$ tar -xzvf techbrown.tar.gz -C /home/techbrown/

tar.bz2

$ tar -xjvf techbrown.tar.bz2 -C /home/techbrown/

tar.xz

$ tar -xJvf techbrown.tar.xz -C /home/techbrown/

After that the Tar Command More Options or Help Manual can be found by using manual command.

$ man tar

Congratulations now you have extracted those tarball files using using Linux.

You Might Also Like

How to Optimize MySQL Performance on AlmaLinux / Rocky Linux

How to Enable TLS 1.3 on Apache and Nginx

5 Security Tips to Protect your WordPress Website from Hackers

How to Enable AES-128 Bit SSL Cipher with TLS 1.3 on Nginx Web Server

How to Set Up NGINX Web Server on AlmaLinux / Rocky Linux

TechBrown Solutions March 15, 2017
Share this Article
Facebook Twitter Email Print
Leave a comment Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

TRENDING

DevOps

How to Setup Nagios Monitoring using AWS Cloud Formation on Ubuntu Instance

Linux

How to Harden and Secure SSH on Ubuntu / AlmaLinux / Rocky Linux

Linux

How to Set Up NGINX Web Server on AlmaLinux / Rocky Linux

Linux

Linux Disc Quotas for AlmaLinux / Rocky Linux

You Might Also Like

Linux

How to Optimize MySQL Performance on AlmaLinux / Rocky Linux

October 19, 2021
Linux

How to Enable TLS 1.3 on Apache and Nginx

March 14, 2021
Linux

5 Security Tips to Protect your WordPress Website from Hackers

November 8, 2020
Linux

How to Enable AES-128 Bit SSL Cipher with TLS 1.3 on Nginx Web Server

November 7, 2020

Follow US on Social Media

Facebook Twitter Youtube Rss

© 2014 - 2022 TechBrown. All Rights Reserved.

  • About Us
  • Terms of Service
  • Cookie Policy
  • Privacy Policy

Removed from reading list

Undo
Go to mobile version
Welcome Back!

Sign in to your account

Lost your password?