0

trying to exclude all .svn folders in the zipped subfolders

zip -urq bebe.zip * -x .svn

doesn't work...

Michael
  • 397
  • 1
  • 7
  • 15
  • [Unix zip directory but excluded specific subdirectories](https://superuser.com/q/312301/173513), [how to exclude directories and file zipping a directory?](https://askubuntu.com/q/371579), [How to exclude a directory when zipping files](https://unix.stackexchange.com/q/219101/56041), etc. –  Jan 01 '18 at 01:05

2 Answers2

3

Try zip -urq bebe.zip * -x '*/.svn'

Mo.
  • 2,236
  • 17
  • 9
2

It seems like -x works with file names and not with directories. I don't fully understand how this option works.

But I do have a solution for your question :

find . -type d -name .svn -prune -o -print | zip -uq bebe.zip -@

The find command excludes all directories named .svn (-type d -name .svn -prune) and lists all other files and folders (-o -print). The list is passed to zip through a pipe (-@ option read list of files in standard input).

If you don't want to only include directories with regular files, you can use -o -type f -print instead.

Christophe Drevet
  • 2,012
  • 2
  • 18
  • 26