例如: 回声$(日期)-$(日期-r sample.txt)
输出: 90天(例如)
答案 0 :(得分:1)
使用自1970-01-01 00:00:00 UTC以来的%s秒,如
(defun has-a-last-numeric (lst)
(labels ((helper (lst)
(loop :for (e . rest) :on lst
:if (and (null rest) (numberp e))
:do (return-from has-a-last-numeric t)
:if (listp e)
:do (helper e))))
(helper lst)))
答案 1 :(得分:0)
另一种方式
$ ls -l peter.txt
-rwxrw-r--+ 1 pppp qqqq 149 Dec 15 18:39 peter.txt
$ echo "(" $(date +%s) - $(date -r peter.txt +%s) ")/" 86400 | perl -nle ' print eval, " days" '
29.254537037037 days
$