sup*_*ted 5 linux bash shell ubuntu bash-scripting
如何find列出每个文件但从搜索中排除少数目录?
find / -type f -not -path "./foo*" -not -path "/bar*" -print
Run Code Online (Sandbox Code Playgroud)
我在其他 stackexchanges 上看到过示例,例如./,但我尝试过的似乎都不起作用。
这有点有效:
find / -type f -not -path "*foo*" -not -path "*bar*" -print
Run Code Online (Sandbox Code Playgroud)
但事实并非如此;它还从搜索结果中排除名为“foo”和“bar”的文件。
| 归档时间: |
|
| 查看次数: |
5854 次 |
| 最近记录: |