Babak K. Shandiz
Babak K. Shandiz's Blog

Babak K. Shandiz's Blog

Living in the Shell #7; zip

Living in the Shell #7; zip

Babak K. Shandiz's photo
Babak K. Shandiz
ยทDec 1, 2021ยท

1 min read

zip ๐Ÿ—œ๏ธ

Creates ZIP archives.

Test archive integrity -T

zip -T x.zip

Create/update zip archive (add/update file)

zip x.zip ~/.bashrc ~/.profile

Creates x.zip archive file (if not exist) and adds .bashrc and .profile to it.

Add directory and its content -r

zip -r x.zip ~/Documents

Without -r nothing is added.

Add all names except directories -D

zip -D x.zip ~/*

Set password while add/update files -P

zip -P my-password x.zip file-to-add-or-update.txt

Store-only mode (fast, without compression) -0

zip -0 x.zip ~/Pictures

Fast compression mode (fast, low compression) -1

zip -1 x.zip ~/Pictures

Ultimate compression mode (slow, maximum compression) -9

zip -9 x.zip ~/Pictures

Delete file from archive -d

zip -d x.zip .bashrc
ย 
Share this