-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtract
38 lines (25 loc) · 1.03 KB
/
Extract
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
EXTRACT
Source : https://www.interserver.net/tips/kb/extract-tar-gz-files-using-linux-command-line
.tar.gz files are actually an archive (.tar) and compressed by gzip algorithm (.gz)
1) extract and uncompress
tar xvzf <file_name.tar.gz>
2) only uncompress
gunzip file.gz
3) extract and uncompress into different directory
tar xvzf <file_name.tar.gz> -C <path_to_directory>
4) extract and uncompress a specific file.doc from file_name.tar.gz
tar xvzf <file_name.tar.gz> file.doc
5) extract and uncompress .tar.bz2 (these are compressed using bZip2 algo instead of gzip)
tar xvjf <file_name.tar.bz2>
6) Only uncompress .bz2
bunzip2 -dk <file_name.bz2>
7) Extract and uncompress .tar.xz
tar -xf <file_name.tar.xz>
8) Extract .7z
7z x <file_name.7z>
9) Extract from .rar
unrar e -r <file.rar>
10) .zip
unzip <file.zip> //uncompresses and extracts into current folder
unzip -l <file.zip> // lists contents of the .zip file
unzip <file.zip> -d <path_of_folder_in_which_to_extract>