【发布时间】:2019-11-01 20:15:41
【问题描述】:
我想查找 /usr/ 中的所有文件,但不在 /usr/share 中
来自这个帖子Exclude a sub-directory using find 我试过了:
find /usr -type f -not -path /usr/share -print
-> 从 /usr/share 打印文件
来自这个帖子How to exclude a directory in find . command 我试过了:
find /usr -path /usr/share -prune -print
->尽管 /usr/bin 中有文件,但什么也不输出
我也试过了:
find /usr -path ! /usr/share -type f -print
-> 输出错误
【问题讨论】: