Skip to content

Instantly share code, notes, and snippets.

@szabo92
Created March 4, 2018 10:26
Show Gist options
  • Save szabo92/466750b3462d4ed990c2ebf6cce765d1 to your computer and use it in GitHub Desktop.
Save szabo92/466750b3462d4ed990c2ebf6cce765d1 to your computer and use it in GitHub Desktop.
tar
# x: This option tells tar to extract the files.
# v: The “v” stands for “verbose.” This option will list all of the files one by one in the archive.
# z: The z option is very important and tells the tar command to uncompress the file (gzip) or j (bZip2).
# f: This options tells tar that you are going to give it a file name to work with.
tar xvzf file.tar.gz
tar xvjf file.tar.bz2
# Extract to other directory
tar xvzf file.tar.gz -C /path/to/somedirectory
# To extract a specific file:
tar -xvzf file.tar.gz name.f
# View contents:
tar -tvf file.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment