Other

How do I gzip a directory in Solaris?

How do I gzip a directory in Solaris?

7 Answers

  1. compress it using the z (gzip) algorithm.
  2. c (create) an archive from the files in directory ( tar is recursive by default)
  3. v (verbosely) list (on /dev/stderr so it doesn’t affect piped commands) all the files it adds to the archive.
  4. and store the output as a f (file) named archive.tar.gz.

How do I tar and gzip a directory?

Execute the following to create a single .tar file containing all of the contents of the specified directory:

  1. tar cvf FILENAME.tar DIRECTORY/
  2. tar cvfz FILENAME.tar.gz DIRECTORY/
  3. Tarred files compressed with GZIP sometimes use the .
  4. tar cvfj FILENAME.tar.bz2 DIRECTORY/
  5. tar xvf FILE.tar.
  6. tar xvfz FILE.tar.gz.

How do I tar everything in a directory?

It will also compress every other directory inside a directory you specify – in other words, it works recursively.

  1. tar -czvf name-of-archive.tar.gz /path/to/directory-or-file.
  2. tar -czvf archive.tar.gz data.
  3. tar -czvf archive.tar.gz /usr/local/something.
  4. tar -xzvf archive.tar.gz.
  5. tar -xzvf archive.tar.gz -C /tmp.

How does tar and gzip work in Linux?

The tar command will collate all the files into one archive file. It doesn’t compress the file itself. If you combine tar with gzip, the tar command will create one single archive file from the folder and then gzip will compress this archive file. The good thing is that you can do both of these steps in one single command by using the z option.

How to extract a tar.gz file in Solaris?

To extract a tar.gz file in Solaris, run the commands in reverse order. We tell gunzip to extract foo.tar.gz to stdout, pipe the output to tar and instruct tar to extract the tarball from stdin. We were unable to load Disqus.

How to gzip a directory in Linux command line?

If you combine tar with gzip, the tar command will create one single archive file from the folder and then gzip will compress this archive file. The good thing is that you can do both of these steps in one single command by using the z option.

How can I create a compressed tar in Sun Solaris?

Looks like Solaris’s tar doesn’t know how to compress. So just do it manually: That’s all the -z switch of GNU tar does, anyway. The command above will produce file.tar.gz. Check if you have SUNWgtar installed. This the the GNU version of tar and provides /usr/sfw/bin/gtar which will allow the use of the GNU options to tar.