Linux下查看文件精确到秒的修改时间

2020-01-10 15:48:46

参考地址 Linux下查看文件精确到秒的修改时间

今天排查一个BUG遇到一个问题,错误日志中打印的时间精确到秒,但当根据日志中的时间去找对应文件进行验证的时候,发现通过 ls -l 或者 ll 命令,都无法查看到文件精确到秒的修改时间。


最后通过查阅,发现了以下两种方式可以查看文件秒级别的修改时间:


方式一:ls - -full-time 命令

cd 到对应的文件夹,使用 ls --full-time 命令



方式二:stat 文件路径

stat命令除了能看到精确的修改时间信息外,还可以看到文件的其他详细信息。如果仅需要查看指定文件信息,则使用 stat a.txt 形式即可。




  • 2017-11-10 00:06:15

    CORS: credentials mode is 'include'

    XMLHttpRequest cannot load http://localhost/Foo.API/token. The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:5000' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

  • 2017-11-19 00:17:51

    Java如何获取Date的“昨天”与“明天”示例代码

    最近在做项目的时候用到Date和Calendar比较多,而且用到的方式也比较全,突然想到一个问题,Java如何获取Date的"昨天"与"明天",也就是前一天和后一天呢?思考后写出了方法,想着万一以后用到,就总结出来,也方便有需要的朋友们参考借鉴,下面来一起看看吧。