tar/gzip/zstd🔗
tar (tape archive)🔗
used to bundle files into a single archive
Basic Usage🔗
1. Create and Archive🔗
-c
: create archive-v
: verbose output-f
: specify archive filename
2. Extract an Archive🔗
-x
: Extract files- files are extracted into current directory by default
3. List Archive Contents🔗
Common Scenarios🔗
-
Extract to a Specific Directory
-
Create and archive from a Directory
-
Exclude file
-
Extracting only
txt
files -
Combine with
find
archive specific files
gzip🔗
Compress files using .gz
format
Basic Usage🔗
1. Compress a file🔗
2. Decompress a file🔗
3. Compress and Archive🔗
4. Extract .tar.gz
🔗
5. View Compressed files without extraction🔗
- Use
gunzip
as an alias forgzip -d
Zstd (Z Standard)🔗
A modern compression tool with better speed and ratios
Basic Usage🔗
1. Compress a File🔗
2. Decompress a File🔗
3. Compress and Archive🔗
4. Extract .tar.zst
🔗
You can adjust compression level : zstd -19 file.txt
Use unzstd
as alias for zstd -d
Comparison between gzip and zstd🔗
Tool | Speed | Compression Ratio | Common Use Cases |
---|---|---|---|
gzip |
Medium | Good | General-purpose |
zstd |
Fast | Excellent | Modern systems, large data |
Notes🔗
- take a look at
pigz
(parallel implementation of gzip)