+ -
当前位置:首页 → 问答吧 → 显示文件时间包含 年月日 小时分钟秒

显示文件时间包含 年月日 小时分钟秒

时间:2011-05-11

来源:互联网

测试 touch -t 04241112 starttemp  #精确到12分钟
touch -t 04241220 endtemp  #截止到12点20
find [dir] -newer starttemp -a ! -newer endtemp -exec ls -l {} \;
偶然发现这些 文件都不包括年
ls -lh

-rw-rw-r--  1 lh   lh          12 Jan 12 05:05 a.log
-rw-rw-r--  1 lh   lh         724 Dec 30 08:19 a.sql

因为这里文件是09 10 11 3年的
所以想知道 这里 ls或 ll  如何 能显示的时候把 年月日 小时分钟秒能显示出来 ?

作者: liyihongcug   发布时间: 2011-05-11

本帖最后由 shplpy 于 2011-05-11 20:25 编辑


QUOTE:
测试 touch -t 04241112 starttemp  #精确到12分钟
touch -t 04241220 endtemp  #截止到12点20
find [dir ...
liyihongcug 发表于 2011-05-11 19:40




    ls --full-time
ls   -l --time-style=long-iso

作者: shplpy   发布时间: 2011-05-11

man ls:


QUOTE:
      --time-style=STYLE     with -l, show times using style STYLE:
                             full-iso, long-iso, iso, locale, +FORMAT.
                             FORMAT is interpreted like `date'; if FORMAT is
                             FORMAT1<newline>FORMAT2, FORMAT1 applies to
                             non-recent files and FORMAT2 to recent files;
                             if STYLE is prefixed with `posix-', STYLE
                             takes effect only outside the POSIX locale

作者: xiaopan3322   发布时间: 2011-05-11