Compress everything by SSH except a folder in Centos7

Asked

Viewed 78 times

1

I would like to compress everything into zip, or is all content of my public_html however, I need the files folder not to be added for compression.

1 answer

1


To a "one-line command" you will need to know the complete path of all directories you do not want to include in zip.

Sample structure:

pasta1
    a.txt
    b.txt
    pasta2
        c.txt
        d.txt
    pasta3
        e.txt
        f.txt
    pasta4
        g.txt
        h.txt

In charge next, I’m ordering nay compress the folders pasta2 and pasta3:

zip -r novoZip.zip pasta1 -x pasta1/pasta2/\* pasta1/pasta3/\*

My file novoZip.zip will look like this:

pasta1
    a.txt
    b.txt
    pasta4
        g.txt
        h.txt
  • And if I have so I’m inside the public_html/ folder but want to compress everything inside it except the files/ folder? I ALREADY BEING INSIDE PUBLIC_HTML

Browser other questions tagged

You are not signed in. Login or sign up in order to post.