Sunday 8 February 2015

untar command in linux example (Extract or Unpack a tar,tar.xz,tar.gz.tar.bz2 File)

untar command in linux example :

Extract or Unpack a tar,tar.xz,tar.gz.tar.bz2 File

The Linux “tar” stands for tape archive, which is used by large number of Linux/Unix system administrators to deal with tape drives backup. The tar command used to rip a collection of files and directories into highly compressed archive file commonly called tarball or targzip and bzip in Linux. The tar is most widely used command to create compressed archive files and that can be moved easily from one disk to anther disk or machine to machine.
Here,
  • -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).

Extract or Unpack a tar,tar.xz,tar.gz.tar.bz2 File

To unpack or extract a tar file, type:
tar -xvf file.tar
or
tar -xvf file.tar.xz
To save disk space and bandwidth over the network all files are saved using compression program such as gzip or bzip2. To extract / unpack a .tar.gz (gzip) file, enter (note -z option):
tar -xzvf file.tar.gz
To extract / unpack a .tar.bz2 (bzip2) file, enter (note -j option):
tar -xjvf file.tar.bz2



No comments: