Difference between revisions of "Linux tar"

From John Freier
Jump to: navigation, search
Line 4: Line 4:
 
To tar up a folder
 
To tar up a folder
 
  tar -czf ./destination.tgz ./source/*
 
  tar -czf ./destination.tgz ./source/*
 +
 +
These options mean
 +
c - create a new archive
 +
z - use gzip to compress the archive
 +
f - file
 +
 +
When using tar, these are the extensions.
 +
  *.tar - just archived no compression
 +
  *.tgz - dos use to only allow three char extensions, so this is tar and gziped.
 +
  *.tar.gz  -  modern extension for tar and gzip compressed.

Revision as of 09:24, 17 March 2016

Tar commands


To tar up a folder

tar -czf ./destination.tgz ./source/*

These options mean

c - create a new archive
z - use gzip to compress the archive
f - file

When using tar, these are the extensions.

 *.tar - just archived no compression
 *.tgz - dos use to only allow three char extensions, so this is tar and gziped.
 *.tar.gz  -  modern extension for tar and gzip compressed.