JiFu's Wiki JiFu's Wiki
首页
  • HTML
  • JavaScript
  • NodeJS
  • Vuejs
  • 微信小程序
  • Python
  • 数据库
  • 中间件
  • 算法
  • 软件工程
  • Wordpress
  • iOS开发
  • Android开发
  • Linux
  • Windows
  • MacOS
  • Docker
  • Vim
  • VSCode
  • Office
  • 其他
  • Photoshop
  • Sketch
  • Mac
  • 游戏
关于
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
首页
  • HTML
  • JavaScript
  • NodeJS
  • Vuejs
  • 微信小程序
  • Python
  • 数据库
  • 中间件
  • 算法
  • 软件工程
  • Wordpress
  • iOS开发
  • Android开发
  • Linux
  • Windows
  • MacOS
  • Docker
  • Vim
  • VSCode
  • Office
  • 其他
  • Photoshop
  • Sketch
  • Mac
  • 游戏
关于
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • DevOps介绍
  • Linux

    • Linux介绍
    • Linux系统目录结构及详细说明
    • 使用SSH登录Google Cloud Platform
    • 生产服务器虚拟化环境搭建大纲
    • 服务器虚拟化环境搭建
    • Ubuntu

    • CentOS

    • Manjaro

    • Command

      • find命令快速技巧:如何定位一个文件
      • history命令设置linux查看历史命令显示执行时间
      • 定时任务Crontab命令详解
      • 通过编写 chroot 来认识 chroot 发挥的作用和它带来的好处
      • Linux 中的模糊文件搜索fzf
      • fdisk磁盘管理工具
    • System Service

  • MacOS

  • Windows

  • Docker

  • Vim

  • VSCode

  • Office

  • 其他

  • 运维
  • Linux
  • Command
JiFu
2023-09-13

history命令设置linux查看历史命令显示执行时间

# 修改配置文件

[root@iZwz90n2a7lzpav1xsdmiqZ ~]# vim /etc/profile
1

# 添加至末尾行

export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S  "
1

# 重载配置

[root@iZwz90n2a7lzpav1xsdmiqZ ~]# source /etc/profile
1

# 查看结果

[root@iZwz90n2a7lzpav1xsdmiqZ ~]# history
  988  2019-04-13 14:04:10  ls
  989  2019-04-13 14:04:10  su - shilvfei
  990  2019-04-13 14:04:10  ls
  991  2019-04-13 14:04:10  cat /etc/group
  992  2019-04-13 14:04:10  groupadd dev
  993  2019-04-13 14:04:10  usermod -G dev shilvfei
  994  2019-04-13 14:04:10  env
  995  2019-04-13 14:04:10  su - shilvfei
  996  2019-04-13 14:04:10  ls
  997  2019-04-13 14:04:10  cat /etc/group
  998  2019-04-13 14:04:10  groupadd lamp1
  999  2019-04-13 14:04:10  grep "lamp1" /etc/passwd
 1000  2019-04-13 14:04:10  grep "shilvfei" /etc/passwd
 1001  2019-04-13 14:04:11  ls
 1002  2019-04-13 14:04:16  vim /etc/profile
 1003  2019-04-13 14:04:38  source /etc/profile
 1004  2019-04-13 14:04:39  ls
 1005  2019-04-13 14:04:42  history
 1006  2019-04-13 14:06:42  vim /etc/profile
 1007  2019-04-13 14:08:47  history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#Command#history
上次更新: 2024/08/11, 01:59:03
find命令快速技巧:如何定位一个文件
定时任务Crontab命令详解

← find命令快速技巧:如何定位一个文件 定时任务Crontab命令详解→

最近更新
01
WPS快捷键
05-21
02
Disable notification "to get future google chrome updates you'll need macos 10.13 or later" on mac
05-14
03
MacOS软件推荐
04-30
更多文章>
Theme by Vdoing | Copyright © 2019-2025 Ji Fu | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式