#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2004
    Posts
    597
    Rep Power
    15

    About tar and gzip commands


    Hi folks,


    OBSD 4.1

    Can you please shed me some light to compress a directory as .tar.gz file with tar and gzip commands in one pass?

    $ tar cpf - /path/to/Directory | gzip > Directory.tar.gz
    ???

    and how to redecompress it to a designated directory, also in one pass?

    TIA


    B.R.
    satimis
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    OpenBSD (at least since 4.0) now supports the -z command for tar . So you can do this:
    tar zcf directory.tar.gz /path/to/directory/*
    and to unzip and extract:
    tar zxf directory.tar.gz
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2004
    Posts
    597
    Rep Power
    15
    Originally Posted by Scorpions4ever
    OpenBSD (at least since 4.0) now supports the -z command for tar . So you can do this:
    tar zcf directory.tar.gz /path/to/directory/*
    and to unzip and extract:
    tar zxf directory.tar.gz
    Noted with tks.

    What is the difference between .tar.gz and .tgz? Are they the same?

    Tks


    B.R.
    satimis
  6. #4
  7. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    Yep. There is no difference.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2004
    Posts
    597
    Rep Power
    15
    Originally Posted by Scorpions4ever
    Yep. There is no difference.
    Noted with tks.


    satimis

IMN logo majestic logo threadwatch logo seochat tools logo