sudo apt-get install zip
zip -r compressed_filename.zip foldername
tip:
-r 表递归压缩目录
后面跟输出文件
再后面跟输入文件夹
解压需要安装另一个命令:
sudo apt-get install unzip
unzip test.zip –d /home/user/destination
The –d
switch tells the system to put the unzipped files somewhere else. You can substitute the path to a location of your choice for /home/user/destination.
unzip test.zip
The system will decompress the test.zip file, and place a copy of its contents in the current directory.