|
6 | 6 | 1. [Linux Navigation Byte](#linux-navigation-commands)
|
7 | 7 | 2. [Files & Directories Byte](#files-and-directories)
|
8 | 8 | 3. [SSH Byte](#ssh-command)
|
| 9 | +3a. [Zip Byte](#zip-command) |
9 | 10 | 4. [SCP Byte](#scp-command)
|
10 | 11 | 5. [Sed Byte](#sed-command)
|
11 | 12 | 6. [Grep Byte](#grep-command)
|
@@ -235,6 +236,33 @@ Host webserver
|
235 | 236 | Hostname server2
|
236 | 237 | LocalForward 8080:localhost:80 # Expose local port 8080 to remote port 80
|
237 | 238 | ```
|
| 239 | +## ZIP Command |
| 240 | +> To make .zip from folders we use this utility. It does not preserve ownership information. To preserve it, we should use `tar` utility. |
| 241 | +```shell |
| 242 | +## SYNTAX |
| 243 | +## zip OPTIONS ARCHIVE_NAME FILES |
| 244 | +zip files.zip file1 file2 |
| 245 | + |
| 246 | +# suppress the output |
| 247 | +zip -q files.zip file1 file2 file3 |
| 248 | + |
| 249 | +# archive a directory |
| 250 | +zip -r files.zip filesDir/ |
| 251 | + |
| 252 | +# add other files to the zip as well |
| 253 | +zip -r files.zip filesDir/ file1.txt ../shoaib/files.txt |
| 254 | + |
| 255 | +## By default compression method used is : deflate |
| 256 | +## SUPPORTED METHODS: |
| 257 | +## 1. deflate |
| 258 | +## 2. bzip2 |
| 259 | +# if a file cannot be compress,it stored as is |
| 260 | +zip -r -Z bzip2 filesDir/ |
| 261 | + |
| 262 | +# specify compression level from 0-9 |
| 263 | +# default is 6 and 0 is no compression |
| 264 | +zip -9 -r hello.zip filesDir/ |
| 265 | +``` |
238 | 266 | ## SCP Command
|
239 | 267 | > SCP or Secure Copy is used to copy files to and from a machine over an ssh connection. Files are encrypted while transfer so, its safe. SCP uses ':' to differentiate between
|
240 | 268 | >
|
|
0 commit comments