Aristotle
发布于 2023-12-05 / 8 阅读 / 0 评论 / 0 点赞

linux find 排除某个目录

linux find 排除某个目录

参考:https://cloud.tencent.com/developer/article/1543082

找找根目录小类型为文件的名字为readme.txt的文件,排除 /mnt下的子目录

root@DESKTOP-55RL3Q1:/usr/local# find / -path /mnt -prune -o -type f -name "readme.txt"
/www/readme.txt
/mnt
/opt/1panel/readme.txt
find: File system loop detected; ‘/sys/kernel/debug/device_component’ is part of the same file system loop as ‘/sys/kernel/debug’.