Last active
December 11, 2015 01:49
-
-
Save msbanik/4526230 to your computer and use it in GitHub Desktop.
zip and unzip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#uncompress .gz file | |
gunzip -d file_name | |
# compress | |
tar -cvzf tarballname.tar.gz itemtocompress | |
#uncompress | |
gunzip filename.tar.gz | |
tar -xvf filename.tar | |
Task: List the contents of a tar file | |
Use the following command: | |
$ tar -tvf file.tar | |
Task: List the contents of a tar.gz file | |
Use the following command: | |
$ tar -ztvf file.tar.gz | |
Task: List the contents of a tar.bz2 file | |
Use the following command: | |
$ tar -jtvf file.tar.bz2 | |
Where, | |
t: List the contents of an archive | |
v: Verbosely list files processed (display detailed information) | |
z: Filter the archive through gzip so that we can open compressed (decompress) .gz tar file | |
j: Filter archive through bzip2, use to decompress .bz2 files. | |
f filename: Use archive file called filename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment