Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Linux, zip multiple directories in one named zip file [closed]

Tags:

linux

zip

I have the following directories, I want to zip up into the same zip file. Can someone provide the correct syntax?

ie. zipping the following directories:

  • /home/users/jlefler/files
  • /opt/software/reports/files

into a zip file called backup.zip.

like image 906
user3299633 Avatar asked Jul 10 '15 14:07

user3299633


People also ask

How do I zip multiple folders into a zip file in Linux?

Select the “Files” option : your file explorer should start automatically. Now that you are in your file explorer, select multiple folders by holding the “Control” key and left-clicking on all the folders to be zipped. When you are done, right-click and select the “Compress” option.

How do I zip multiple folders into a zip file?

Right-click on the file or folder. Select “Compressed (zipped) folder”. To place multiple files into a zip folder, select all of the files while hitting the Ctrl button. Then, right-click on one of the files, move your cursor over the “Send to” option and select “Compressed (zipped) folder”.

Can multiple folders be zipped?

Zipping Multiple FilesHold down [Ctrl] on your keyboard > Click on each file you wish to combine into a zipped file. Right-click and select "Send To" > Choose "Compressed (Zipped) Folder."

How compress multiple folders in Linux?

To compress a single file by running tar -zcvf file. tar. gz /path/to/filename command on Linux. Tar and compress multiple directories file by running tar -zcvf file.


1 Answers

try

zip -r backup.zip /home/users/jlefler/files /opt/software/reports/files 

you can add more directories at the end of the command

like image 99
Kiril Ivanov Avatar answered Sep 20 '22 13:09

Kiril Ivanov