Find the answer to your Linux question:
Results 1 to 3 of 3
Hey all, Is there any way to extract a single file or directory from a .tgz archive? I've got a 15GB archive and people are complaining about a performance decrease ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! sir_saucealot's Avatar
    Join Date
    Aug 2004
    Posts
    41

    Tar commands


    Hey all,

    Is there any way to extract a single file or directory from a .tgz archive? I've got a 15GB archive and people are complaining about a performance decrease when I untar the whole thing (and it takes a while). Any help would be appreciated.

    Thanks,

    Sauce

  2. #2
    Just Joined!
    Join Date
    May 2004
    Location
    Pennsylvania
    Posts
    98
    sure,
    just list the file/directory after the untar command.

    for instance lets say we have an archive "website.tar.gz"
    and we just want the "public_html" folder

    Code:
    tar -xzvf website.tar.gz public_html
    this will extract just the public_html directory.

    Hope this helps.

  3. #3
    Just Joined! sir_saucealot's Avatar
    Join Date
    Aug 2004
    Posts
    41
    No probs - thanks!

    I just got a bit confused with the leading slash and the directory structure inside the archive (about 12 directories deep, the file was!).

    Thanks again,

    Sauce

  4. $spacer_open
    $spacer_close

Posting Permissions

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