Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个目录 LOG 的问题。因为那里有这么多的文件和目录。我想找到并删除以 PS 开头的文件。但它不应该检查子目录。
使用find带有 maxdepth选项的工具:
find
maxdepth
find LOG-PATH -maxdepth 1 -regextype "posix-egrep" -regex '.*/PS.*' -type f -exec rm {} \;