Linux How To Zip Folder on Linux

David Espinosa

Developer
Staff member
Journeyman
novice
phfree.xyz
up.sikatpinoy.com
Awards
3
  • 100 Post Award
  • Somebody likes you
  • First Message
Screenshot_2021_0904_194600.png
  • Zip Folder using zip
The easiest way to zip a folder on Linux is to use the “zip” command with the “-r” option and specify the file of your archive as well as the folders to be added to your zip file.
You can also specify multiple folders if you want to have multiple directories compressed in your zip file.
Code:
$ zip -r <output_file> <folder_1> <folder_2> ... <folder_n>
For example, let’s say that you want to archive a folder named “Documents” in a zip file named “temp.zip”.
In order to achieve that, you would run the following command
Code:
In order to check if your zip file was created, you can run the “ls” command and look for your archive file.
Code:
$ ls -l | grep .zip
 

Wallet

SikatPoints
0
Top