I would like to exclude some Windows folders on an NTFS mount from being indexed by locate. I'm familiar with the PRUNEPATHS syntax in /etc/updatedb.conf.  It is a white-space separated list of directory names.My problem is that I want to exclude directories that contain white space themselves (e.g. Program Files (x86)).I tried backslash escapes but that didn't work.
How to exclude directories with blanks via locate's PRUNEPATHS?
directory;locate
In updatedb.sh line 175 gives a hint:PRUNEREGEX=`echo $PRUNEPATHS|sed -e 's,^,\\\(^,' -e 's, ,$\\\)\\\|\\\(^,g' -e 's,$,$\\\),'`There the $PRUNEPATHS is handled like plain text, the ' ' characters are replaced and no escaping is possible.To ensure the space survives that line 175, you must denote it without explicitly mentioning it. The best way I know is to use \s, which means a whitespace character:PRUNEPATHS='/path/to/Program\sFiles\s(x86)'(That will also include tab and newline characters, but in this case will be fine for you.)Another way is to set $PRUNEREGEX directly, as updatedb would do in line 175:PRUNEREGEX='\(^/path/to/Program Files (x86)$\)'There you separate multiple paths with \|, so space is not an issue anymore:PRUNEREGEX='\(^/path/to/Program Files (x86)$\)\|\(^/foo/bar$\)'