首页 > 解决方案 > 如何使用 -haltr 格式仅显示子目录内的文件?

问题描述

如何将输出外观添加ls -haltr到下面的命令中?

find 20180913/ -maxdepth 5 -not -type d -and -not -name '.*'

基本上我试图只列出我的子目录中的文件,但需要显示按日期排序的文件时间戳,最新的在底部。

谢谢

标签: linuxbash

解决方案


您可以尝试使用以下exec选项find

find 20180913/ -maxdepth 5 -not -type d -and -not -name '.*' -exec ls -haltr {}  +

根据 PesaThe 的更正更新了我的答案。


推荐阅读