forked from cheat/cheatsheets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gzip
20 lines (15 loc) · 517 Bytes
/
gzip
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
---
tags: [ compression ]
---
# To create a *.gz compressed file
gzip test.txt
# To create a *.gz compressed file to a specific location using -c option (standard out)
gzip -c test.txt > test_custom.txt.gz
# To uncompress a *.gz file
gzip -d test.txt.gz
# Display compression ratio of the compressed file using gzip -l
gzip -l *.gz
# Recursively compress all the files under a specified directory
gzip -r documents_directory
# To create a *.gz compressed file and keep the original
gzip < test.txt > test.txt.gz