Determining age of a file in shell script

后端 未结 6 1094
暖寄归人
暖寄归人 2021-01-04 18:28

G\'day,

I need to see if a specific file is more than 58 minutes old from a sh shell script. I\'m talking straight vanilla Solaris shell with some POSIX extensions i

6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-04 18:55

    You can use different units in the find command, for example:

    find . -mtime +0h55m
    

    Will return any files with modified dates older than 55 minutes ago.

提交回复
热议问题