Skip to content

Instantly share code, notes, and snippets.

@midwire
Last active March 19, 2021 17:32
Show Gist options
  • Save midwire/423aae1718a9d56e0782a7f7e6bebec9 to your computer and use it in GitHub Desktop.
Save midwire/423aae1718a9d56e0782a7f7e6bebec9 to your computer and use it in GitHub Desktop.
[Tar Gzip Files] Create, Decompress *.tar.gz files #tar #linux #devops
# For a couple files..
tar -czf archive.tar.gz file1 file2
# For an entire directory - recursively
tar -cfz archive.tar.gz directory_path
# Create an archive and send to another host over SSH - extract it there
tar cvf - project | ssh user@ip_addr "tar xv -C /var/www"
# Extract a tar.gz file
tar -xvf archive.tar.gz [optional list of files and dirs]
# With wildcards
tar -xf archive.tar.gz --wildcards '*.js'
# Remote archives
wget -c https://download.blender.org/source/blender-2.80.tar.gz -O - | sudo tar -xz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment