具有日期和时间的Linux命令历史记录 [英] Linux Command History with date and time

查看:241
本文介绍了具有日期和时间的Linux命令历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检查我的linux系统何时触发了哪个命令-在哪个日期和时间.

I wants to check on my linux system when which command was fired - at which date and time.

我触发了这样的命令:

history 50 

它向我显示了最近50条命令的历史记录,但没有显示它被触发的日期和时间.有人知道怎么做吗?

It shows me the last 50 commands history, but not with date and time at which it was fired. Does any one knows how to do it?

推荐答案

关于此链接,您可以通过执行以下操作,使 krzyk提供的第一个解决方案永久生效. /p>

Regarding this link you can make the first solution provided by krzyk permanent by executing:

echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bash_profile
source ~/.bash_profile

这篇关于具有日期和时间的Linux命令历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆