25 lines
511 B
Plaintext
25 lines
511 B
Plaintext
% compression
|
|
|
|
# Create a tar archive
|
|
tar cf <name>.tar <files>
|
|
|
|
# Extract a tar archive
|
|
tar xf <tar_file>
|
|
|
|
# Create a tar archive with gz compression
|
|
tar czf <name>.tar.gz <files>
|
|
|
|
# Extract a tar using gz compression
|
|
tar xzf <targz_file>
|
|
|
|
# Create a gz archive
|
|
gzip -9 -c <files> > <name>.gz
|
|
|
|
# Extract a gz archive
|
|
gzip -d <gz_file>
|
|
|
|
$ files: ls | awk -F: '{ print $1}'
|
|
$ tar_file: ls *.tar | awk -F: '{ print $1}'
|
|
$ targz_file: ls *.tar.gz | awk -F: '{ print $1}'
|
|
$ gz_file: ls *.gz | awk -F: '{ print $1}'
|