修改Linux目录文件列表的时间显示格式

编辑全局配置文件

在终端中编辑 vim /etc/profile 文件,在配置文件中添加 export TIME_STYLE="+%Y-%m-%d %H:%M:%S" 语句,然后保存退出。

让配置立即生效

在终端中执行 source /etc/profile 命令,让配置文件立即生效。然后通过 ll 命令查看结果。

局部代码和效果

[root@ser cert]# vim /etc/profile
  1 # /etc/profile
  2
  3 # System wide environment and startup programs, for login setup
  4 # Functions and aliases go in /etc/bashrc
  5
  6 # It's NOT a good idea to change this file unless you know what you
  7 # are doing. It's much better to create a custom.sh shell script in
  8 # /etc/profile.d/ to make custom changes to your environment, as this
  9 # will prevent the need for merging in future updates.
 10 export TIME_STYLE="+%Y-%m-%d %H:%M:%S"
 11 pathmunge () {
 12     case ":${PATH}:" in
 13         *:"$1":*)
 14             ;;
 15         *)
 16             if [ "$2" = "after" ] ; then
 17                 PATH=$PATH:$1
 18             else
 19                 PATH=$1:$PATH
 20             fi
 21     esac
 22 }
[root@ser cert]# 
[root@ser cert]# source  /etc/profile
[root@ser cert]# pwd
/etc/nginx/cert
[root@ser cert]# ll
total 48
-rw-r--r-- 1 root root 3851 2021-12-03 12:25:12 confluence.vfire.cn_chain.crt
-rw-r--r-- 1 root root 1675 2021-12-03 12:25:12 confluence.vfire.cn_key.key
-rw-r--r-- 1 root root 3839 2021-12-03 12:39:35 docker.vfire.cn_chain.crt
-rw-r--r-- 1 root root 1679 2021-12-03 12:39:35 docker.vfire.cn_key.key
-rw-r--r-- 1 root root 3843 2021-12-03 12:36:20 jenkins.vfire.cn_chain.crt
-rw-r--r-- 1 root root 1679 2021-12-03 12:36:20 jenkins.vfire.cn_key.key
-rw-r--r-- 1 root root 3831 2021-12-03 12:39:48 mysql.vfire.cn_chain.crt
-rw-r--r-- 1 root root 1675 2021-12-03 12:39:48 mysql.vfire.cn_key.key
-rw-r--r-- 1 root root 3680 2021-11-15 14:03:06 x.51shuxiaohan.com_chain.crt
-rw-r--r-- 1 root root 1675 2021-11-15 14:03:06 x.51shuxiaohan.com_key.key
-rw-r--r-- 1 root root 3680 2021-11-15 14:02:50 x.vfire.cn_chain.crt
-rw-r--r-- 1 root root 1675 2021-11-15 14:02:50 x.vfire.cn_key.key
[root@ser cert]# 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值