我找到并调整了这个脚本,以递归方式在目录中查找最近修改过的文件。只有当目录名中有空格时,它才会中断。谁可以帮助我调整脚本,使它将读取目录与空间也?
for i in *; do
find $i -type f | perl -ne 'chomp(@files = <>); my $p = 9; foreach my $f (sort { (stat($a))[$p] <=> (stat($b))[$p] } @files) { print scalar localtime((stat($f))[$p]), "\t", $f, "\n" }' | tail -1
done发布于 2012-09-19 16:53:37
Perl?你没有bash,而且你喜欢写长行代码?;-)
find . -type f -printf '%T+ %p\n' | sort -r | head -n1https://stackoverflow.com/questions/10707145
复制相似问题