Bandai2
asked on
How to zip certain folders only using SSH & Putty?
I have a file structure like this on one of the servers I'm working on online:
foldera/
-subfoldera/
-filexx.xx
-filexxx.xx
folderb/
folderc/
folderd/
foldere/
folderf/
file1.xx
file2.xx
file3.xx
I would like to put all files and folders and the contents inside each folder except for folderc in one zip file name bd.zip
How can I do this in SSH using Putty?
foldera/
-subfoldera/
-filexx.xx
-filexxx.xx
folderb/
folderc/
folderd/
foldere/
folderf/
file1.xx
file2.xx
file3.xx
I would like to put all files and folders and the contents inside each folder except for folderc in one zip file name bd.zip
How can I do this in SSH using Putty?
zip -r name.zip foldera/* foldrb/* folderc/* folderd/* foldere/* folderf/* file1.xx file2.xx file3.xx
ahh sorry didnt see the folderC exclusion
zip -r name.zip foldera/* folderb/* folderd/* foldere/* folderf/* file1.xx file2.xx file3.xx
zip -r name.zip foldera/* folderb/* folderd/* foldere/* folderf/* file1.xx file2.xx file3.xx
and the name.zip should obviously be bd.zip
ASKER
I have to type the folder names and file names one by one? Is there no other way to do this? I have like over 50 folders and files are over a hundred.. I just need to exclude a couple of folders from the zip file..
Also the file structure above is also inside another folder, so maybe that would help..
Also the file structure above is also inside another folder, so maybe that would help..
Ok well you could do
zip -r bd.zip * -x folderc/* etc etc
i.e add the whole tree but exclude a number of files/folders with the -x.
zip -r bd.zip * -x folderc/* etc etc
i.e add the whole tree but exclude a number of files/folders with the -x.
ASKER
zip -r bd.zip * -x folderc/* etc etc
this only work with files.. it still include the folders I excluded.
this only work with files.. it still include the folders I excluded.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.