Thursday, December 18, 2008

In Unix, how can I uncompress *.Z or *.tar.Z files?

In Unix, how can I uncompress *.Z or *.tar.Z files?
If you are on a Unix system, to uncompress *.Z or *.tar.Z files, at the shell prompt, enter:

uncompress *.Z
Use the ls command to check the resulting files. If uncompress creates a .tar file, you must extract the files by entering:

tar -xvf *.tar
Alternatively, to do this in one step and avoid creating the intermediate *.tar file, enter:

zcat *.Z | tar -xvf -