Extract tar files in Linux

Many of beginners dont know how to extract tar files in Linux.

What is tar file?

TAR actually stands for tape archive. This is a standard format in Unix/Linx. TAR files are the most popular form of archive used on a Unix/Linux system. The extension is .tar.gz or .tar.bz2

Extract tar files in Linux:

1. Open the Shell or Terminal

2. Navigate to tar file location(We can also extract files without navigating to file lcoation)

3. Enter following format.

tar -zxf filename or file path

Examples:

To see the files in current directoreis

root@ubuntu:/home/prvr/Downloads# ls -ltrh
total 19M
-rw-rw-r– 1 prvr prvr 18M May 31 01:32 hadoop-2.7.3-src.tar.gz
-rw-rw-r– 1 prvr prvr 728K Jun 28 19:44 sakila-db.tar.gz

Extract tar file sakila-db.tar.gz

root@ubuntu:/home/prvr/Downloads# tar -zxf sakila-db.tar.gz

Check the files after extraction

root@ubuntu:/home/prvr/Downloads# ls -ltrh

total 19M
drwxr-xr-x 2 500 500 4.0K Jul 20 2016 sakila-db
-rw-rw-r– 1 prvr prvr 18M May 31 01:32 hadoop-2.7.3-src.tar.gz
-rw-rw-r– 1 prvr prvr 728K Jun 28 19:44 sakila-db.tar.gz

CheapSexCams
Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Powered by k2schools
%d bloggers like this: