Page 1 of 1

'exclude' syntax for excluding multiple files/directories

Posted: Thu Mar 25, 2010 12:03 am
by RonC
The December 14 illustrations on exclude syntax described everything, except for one point:
Also it's important to understand how --exclude is implemented:
1) "--exclude=xxx" can match both files and directories (including links, special files, ...)
2) when "--exclude=xxx" matches a directory, all its files/subdirs are ignored
3) "--exclude=sbin" will exclude both /sbin, /usr/sbin, /usr/local/sbin, ...
4) "--exclude=/sbin" will exclude only /sbin
5) shell asterisks can be used: "--exclude='*.[ch]" will exclude "*.c" and "*.h"
6) "--exclude=xxx" can be used during "restfs" as well as "savefs"
What's the syntax for excluding multiple files/directories, not containing common characters in their names? May it be done with a single exclude statement, and if yes, how are the parameters supposed to be separated??

[Edit: may I guess, from searching elsewhere for similar command structures, you simply concatenate them, each separated from the other with a space character? ]

Re: 'exclude' syntax for excluding multiple files/directories

Posted: Sun Apr 11, 2010 8:20 am
by admin
You can just do that:

Code: Select all

--exclude=myfile1.txt --exclude=pagefile.sys --exclude='*.tmp' --exclude=/var/tmp

Re: 'exclude' syntax for excluding multiple files/directories

Posted: Sun Apr 11, 2010 3:01 pm
by RonC
Thanks! I was going to guess just separating the file names themselves, one after another, with a space, but now I don't have to guess.