Find the answer to your Linux question:
Results 1 to 4 of 4
Hello, is there a simple method to provide a directory into which a tar archive is to be decompressed? Code: tar xvzf example.tar.gz will untar it into the current directory. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    32

    [SOLVED] untar into a given directory


    Hello,
    is there a simple method to provide a directory into which a tar archive is to be decompressed?
    Code:
    tar xvzf example.tar.gz
    will untar it into the current directory. What is the way to change that?
    Thanks in advance,
    IH

  2. #2
    Linux User peteh's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    340
    I usually cd into the appropriate folder first and then tar x.
    There may also be another way but this works for me.
    Pete

  3. #3
    Linux Newbie
    Join Date
    Sep 2004
    Location
    UK
    Posts
    161
    From the man page :

    tar -C <dir_to_untar_into> xvzf example.tar.gz
    In a world without walls and fences, who needs Windows and Gates?

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Sep 2009
    Posts
    32
    Thank both of you - I overlooked the -C option.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •