utime {最后访问时间}, {最后修改时间}, 要修改的文件列表;
#!/usr/bin/perl
my $now = time;
my $ago = $now - 24 * 60 * 60; #一天前
#最后访问时间为当前时间,最后修改时间为前一天
utime $now, $ago, glob "*.txt";
ls -l *.txt
-rw-r--r-- 1 beyes beyes 0 Oct 11 14:48 test1.txt
-rw-r--r-- 1 beyes beyes 0 Oct 11 14:48 test2.txt
-rw-r--r-- 1 beyes beyes 0 Oct 11 14:48 test3.txt
-rw-r--r-- 1 beyes beyes 0 Oct 11 14:48 test4.txt
-rw-r--r-- 1 beyes beyes 0 Oct 11 14:48 test5.txt
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |