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