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.
我正在尝试查找超过特定天数的文件并将其删除
subprocess.call(['find', DIRECTORY, '-mtime', '+5', '-exec', 'rm', '{}', r'\ '])
为什么这个电话给我missing argument to -exec错误信息
missing argument to -exec
使用exec时,您需要一个分号来表示命令的结束。
exec
subprocess.call(['find', DIRECTORY, '-mtime', '+5', '-exec', 'rm', '{}', ';'])