Monday, September 1, 2014

How to open or Untar a ".tar.gz" file in Ubuntu ?

Lets say that the name of file is - test.tar.gz
  1. From the terminal, change to the directory where tar file is located.
  2. Now to extract the file to the current directory , run the command 
  3.  tar -zxvf test.tar.gz

    To extract the file to a specific directory , run
    tar -C /directory_name -zxvf test.tar.gz

    NOTE : The extensions .tgz and .tar.gz are equivalent and both signify that a tar file zipped with gzip.
How to Untar a ".tar" file ?
  1. From the terminal, change to the directory where tar file is located.
  2. Now to extract the file to the current directory , run the command 
  3. tar -xvf test.tar

    To extract the file to a specific directory , run
    tar -C /directory_name -xvf test.tar

Tar Usage and Options
  • c – create a archive file.
  • x – extract a archive file.
  • v – show the progress of archive file.
  • f – filename of archive file.
  • t – viewing content of archive file.
  • j – filter archive through bzip2.
  • z – filter archive through gzip.
  • r – append or update files or directories to existing archive file.
  • W – Verify a archive file.
  • wildcards – Specify patters in unix tar command.
 


     

No comments :

Post a Comment