1

我正在尝试查找超过特定天数的文件并将其删除

subprocess.call(['find', DIRECTORY, '-mtime', '+5', '-exec', 'rm', '{}', r'\ '])

为什么这个电话给我missing argument to -exec错误信息

4

1 回答 1

3

使用exec时,您需要一个分号来表示命令的结束。

subprocess.call(['find', DIRECTORY, '-mtime', '+5', '-exec', 'rm', '{}', ';'])
于 2013-05-14T12:25:36.487 回答