使用 ls -l 看文件修改时间,经常出现 Dec, Jul 之类的东西,这东西它认识我,我不认识它啊
要是开了 LANG=zh 之类的在实控制台下又会出现 12口 4口之类的,显示又不正常。
一fire之下把所有locale都装上
for i in `locale -a` ; do
env LC_TIME=$i ls -l
echo $i
echo '-------------'
done
显示全部locale的时间格式
现在用 env LC_TIME=lt_LT ls -l 执行一下,时间显示成 2011-12-22 12:54 , 一看就清爽,一目了然~~
这个locale 又好记,小写lt,大写LT,也不知道哪个地区的
把这个东西写到 /etc/environment 或者自己的 .bashrc 里去,下次启动就OK了
修改 ls -l 时间显示格式
- YeLee
- 论坛版主
- 帖子: 26406
- 注册时间: 2008-08-13 8:48
- 系统: Fundu i64
- 来自: 东海硇州,一双管钥。
- 联系:
Re: 修改 ls -l 时间显示格式
嗯,不错




◎当我站在道德的高度上俯视别人的时候,发现自己是多么渺小。
♥执着但不偏激,反对而不排斥,坚决捍卫矛盾体的存在方式。
★★★天气预报★★★
fcitx-yatable一个可以使用的码表输入法
[教程]几个实例攻克软件编译难关
Gentoo Development Guide
字体相关
♥执着但不偏激,反对而不排斥,坚决捍卫矛盾体的存在方式。
★★★天气预报★★★
fcitx-yatable一个可以使用的码表输入法
[教程]几个实例攻克软件编译难关
Gentoo Development Guide
字体相关
-
- 帖子: 813
- 注册时间: 2008-04-20 12:13
- 系统: OS X, Gentoo, Win8.1
- 来自: Shanghai, PRC
Re: 修改 ls -l 时间显示格式
$ man ls
--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
$ ls -l --time-style=long-iso
--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
$ ls -l --time-style=long-iso