find /path/ -ctime 1 它有什么作用? PERL

find /path/ -ctime 1 what does it do? PERL

查找/path/ -ctime 1 或查找/path/ -ctime -1

作为一个非英语母语的人,我很难理解它到底是做什么的。

我正在尝试查找超过 n 天的文件并在使用后删除它们

foreach my $l (@list){
 `rm $l`;
}

新编辑

那这是怎么回事?为什么不删除文件?

my @a = `find /home/osboxes/Desktop/teste -ctime -1`;
print @a;

foreach my $l (@a){
 unlink $linha;
}

我试过使用 shell 来 rm 文件:

rm $linha;

输出:

/home/osboxes/Desktop/teste
/home/osboxes/Desktop/teste/asdads
/home/osboxes/Desktop/teste/asdasdwqe

find 命令不在 perl 中,它在 shell 中。换句话说,它是一个系统命令。您可以通过阅读 the find man page.

了解它

-ctime 测试检查文件的状态是否在从今天起 (+1) 之前或 (-1) 之后发生了变化。您可以阅读更多关于 ctime here.