Skip to content

Instantly share code, notes, and snippets.

@huynhsamha
Created March 7, 2019 04:11
Show Gist options
  • Save huynhsamha/759719462ad9eedfe6d7aff207e61dd4 to your computer and use it in GitHub Desktop.
Save huynhsamha/759719462ad9eedfe6d7aff207e61dd4 to your computer and use it in GitHub Desktop.
Tar commands

Create

Without compress (.tar)

tar -cvf abc.tar dir1 file1 file2 other ...
c: create
v: verbose
f: format

Compress with GZip (.tar.gz)

tar -cvzf abc.tar.gz dir1 file1 file2 other ...
c: create
v: verbose
z: zip
f: format

Extract

Without compress (.tar)

tar -xvf abc.tar
tar -xvf abc.tar folder_in_tar file_in_tar ...
x: extract

Compressed with GZip (.tar.gz)

tar -xvzf abc.tar
tar -xvzf abc.tar folder_in_tar file_in_tar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment