How to unpack .tgz file on Linux ?
How to unpack .tgz file on Linux ?
To unpack the .tgz file on linux we use the command as follows:
Most Linux and open source software files are distributed in either .tgz or .tar.gz extensions format over the Internet. These files are gzipd tar balls and include multiple files and sub-directories into a single file using tar command. To save the bandwidth tar files are cpmpressed using gzip program.
tar zxvf fileNameHere.tgz
Or try the geeky [You must be registered and logged in to see this link.] syntax:
gunzip -c fileNameHere.tgz | tar xvf -
tar zxvf backups.tgz
OR
gunzip -c backups.tgz | tar xvf -
Sample outputs:
tar: Removing leading '/' from member names
x Users/vivek/Downloads/db.txt
x Users/vivek/Downloads/resume.txt
x Users/vivek/Downloads/vendors.txt
x Users/vivek/Downloads/sales.txt
To unpack and put files in a different folder (directory) say /tmp/data, enter:
tar zxvf backups.tgz -C /tmp/data ls -l /tmp/data
Most Linux and open source software files are distributed in either .tgz or .tar.gz extensions format over the Internet. These files are gzipd tar balls and include multiple files and sub-directories into a single file using tar command. To save the bandwidth tar files are cpmpressed using gzip program.
Unpacking .tgz files command
The syntax is as follows:tar zxvf fileNameHere.tgz
Or try the geeky [You must be registered and logged in to see this link.] syntax:
gunzip -c fileNameHere.tgz | tar xvf -
Examples
In this example, unpack a file called backups.tgz, enter:tar zxvf backups.tgz
OR
gunzip -c backups.tgz | tar xvf -
Sample outputs:
tar: Removing leading '/' from member names
x Users/vivek/Downloads/db.txt
x Users/vivek/Downloads/resume.txt
x Users/vivek/Downloads/vendors.txt
x Users/vivek/Downloads/sales.txt
To unpack and put files in a different folder (directory) say /tmp/data, enter:
tar zxvf backups.tgz -C /tmp/data ls -l /tmp/data
tar command options
- -z : Uncompress the resulting archive with gzip command.
- -x : Extract to disk from the archive.
- -v : Produce verbose output i.e. show progress and file names while extracting files.
- -f backup.tgz : Read the archive from the specified file called backup.tgz.
- -C /tmp/data : Unpack/extract files in /tmp/data instead of the default current directory.
Similar topics
» Introduction to Linux and Basic Linux Commands for Beginners
» What is the .bashrc file?
» user is not in the sudoers file. This incident will be reported. How to fiw this pb ?
» Linux Commands for Beginners
» The compiler ifort ( from Intel ) for Linux ( 64 bit and 32 bit )
» What is the .bashrc file?
» user is not in the sudoers file. This incident will be reported. How to fiw this pb ?
» Linux Commands for Beginners
» The compiler ifort ( from Intel ) for Linux ( 64 bit and 32 bit )
Permissions in this forum:
You cannot reply to topics in this forum