0
假设我想查找某个文件系统上的特定内容,但省略搜索中的某些目录。我想输入locate string[omit anything which resides in specified directory]
。正则表达式:省略查找字符串
举个例子,比方说,我想省略清单中的/usr/share
。
这是如何完成的?
假设我想查找某个文件系统上的特定内容,但省略搜索中的某些目录。我想输入locate string[omit anything which resides in specified directory]
。正则表达式:省略查找字符串
举个例子,比方说,我想省略清单中的/usr/share
。
这是如何完成的?
locate string | grep -v ^/usr/share
或者,如果你有find
搜索,使用-prune
:
find/-name \*string\* \(-path '/usr/share' -prune -o -print \)