title: Zip command for excluding directories and files
body: <p>i'm trying to use this ssh command in centos 5 to zip up a directory full up folders and files yet exclude the examples below.  it's not working.</p>
  
  <pre><code>zip -r file.zip * -x dir1 -x dir2 -x file1 -x file2
  </code></pre>
  
  <p>or this one</p>
  
  <pre><code>zip -r file.zip * -x "dir1" -x "dir2" -x "file1" -x "file2"
  </code></pre>
  
  <p>It still just zips up the whole directory and everything it in.  I don't want dir1 dir2 file1 file2.</p>
  
  <p>I need to know the right -x syntax for the exclude functions to work. </p>