Bash script to find and display oldest file

前端 未结 4 1347
梦如初夏
梦如初夏 2021-01-21 13:26

I\'m trying to write a script that will display the name of oldest file within the directory that the script is executed from.

This is what I have so far:



        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-21 14:05

    You may use find command: find -type f -printf '%T+ %p\n' | sort | head -1

提交回复
热议问题