linux - 有什么办法可以保留文件名(+日期小时)

标签 linux bash ubuntu find

我想保持这个命令的输出不变,但我不想要路径,只想要文件名。

前任。 04-06-2020 23:09:02 filename不是 04-06-2020 23:09:02 /root/dir1/dir2/filename
这是命令:

find path -type f -printf '%TY-%Tm-%TT %p\n' | sort -r

最佳答案

更改%p%f .

find path -type f -printf '%TY-%Tm-%TT %f\n' | sort -r

%f File's name with any leading directories removed (only the last element).
%p File's name.



Source

关于linux - 有什么办法可以保留文件名(+日期小时),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62204232/

相关文章:

linux - Swift 3 预览版 2 Linux 错误 : use of unresolved identifier

linux - ubuntu盒子开放端口问题

bash - 无法在 bash for windows 中更新和下载任何包

c++ - 在 Linux 环境中使用 C++ 的 BLE 服务器端实现

linux - CentOS 6 解压缩文件,但文件将转至根文件夹

linux - 删除 csv 文件中的自动换行 - Linux

linux - 在 Linux 上的 ghci 中读取标准输入被破坏

linux - grep 语句在 case 语句中不起作用

linux - ElementaryOS Freya - Dropbox 图标

linux - iwlist() 命令如何扫描无线网络?