Determining age of a file in shell script

后端 未结 6 1093
暖寄归人
暖寄归人 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:34

    A piece of the puzzle might be using stat. You can pass -r or -s to get a parseable representation of all file metadata.

    find . -print -exec stat -r '{}' \;
    

    AFAICR, the 10th column will show the mtime.

提交回复
热议问题