shell 判断文件新旧

一、-nt 判断file1是否比file2新

["/data/file1" -nt "/data/file2" ]

二、-ot 判断file1是否比file2旧

["/data/file1" -ot "/data/file2" ]




参考:
https://www.imooc.com/article/325970





posted @ 2023-08-12 15:34  悟透  阅读(69)  评论(0)    收藏  举报