我正在寻找一个命令来从给定目录递归列出所有文件及其修改时间.如果它能够以树形命令生成的树状格式生成输出也会很好.
注意:我正在运行Red Hat Enterprise Linux Server第5版.
编辑:树命令的选项-D仅打印过去几年的最后修改时间的日期部分,尽管它显示当前年份的时间.在这种情况下,我希望在过去的几年中打印日期.
解决方法
I’m looking for a single command to list all files recursively from a
given directory along with its modified time.
$find /path/to/folder -type f -print0 | xargs -0 ls -l --time-style="+%F %T"
It would also be nice if it can produce output in a tree-like format
as produced by tree command.
In my case,precision upto minutes is enough.
在我的CentOS上,Gentoo,… -D选项已在几分钟内显示:
$tree -D . ├── [Jul 26 14:41] LICENSE ├── [Jul 26 14:41] manifests │ ├── [Oct 10 16:30] defines │ │ └── [Jul 26 14:41] redis source.pp │ └── [Jul 26 14:41] init.pp ├── [Jul 26 14:41] README └── [Jul 26 14:41] templates ├── [Jul 26 14:41] redis.conf.erb └── [Jul 26 14:41] redis-server.erb 3 directories,6 files