< 返回新闻公告列表

Debian8系统如何通过history查看历史命令

发布时间:2023-7-3 9:54:05    来源: 纵横云

Debian8系统如何通过history查看历史命令

debian8系统如何通过history查看历史命令?本教程以debian8系统为例

本配置适用于debian8,9版本

1.我们在使用debian系统时,执行的命令会由暂时保存到历史记录里,可以执行history命令来查看。

Debian8系统如何通过history查看历史命令-3566

2.但是有时我们想查看执行命令的具体时间,这时就需要设置下history的时间格式

永久设置history可以显示命令执行时间,

cd /etc/profile.d/

vim env.sh

export HISTTIMEFORMAT="%F %T "

Debian8系统如何通过history查看历史命令-3567

想要立刻看到效果而不重启的话,执行source env.sh

3.输入history -c可以快速清除当前历史记录

Debian8系统如何通过history查看历史命令-3568
19906048601
19906048601 19906048601
返回顶部
返回顶部 返回顶部