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.
在 linux 中,如何删除目录中的所有文件,但实际上是指向其他目录中文件的符号链接的文件除外?
使用find命令:
find
find /path/to/dir -type f -delete
-type f将确保您只删除文件而不是符号链接
-type f