Linux修改系统时间显示为:年月日时分秒
- 1、编辑全局配置文件:/etc/profile,使所有用户均显示该格式:
vim /etc/profile
export TIME_STYLE="+%Y-%m-%d %H:%M:%S"
#or
echo "export TIME_STYLE='+%Y-%m-%d %H:%M:%S'" >> /etc/profile
- 2、让配置立即生效:
source /etc/profile
# 验证配置是否生效
ll
vim /etc/profile
export TIME_STYLE="+%Y-%m-%d %H:%M:%S"
#or
echo "export TIME_STYLE='+%Y-%m-%d %H:%M:%S'" >> /etc/profile
source /etc/profile
# 验证配置是否生效
ll