Linux 配置 history 命令显示操作时间、用户和登录 IP
来源:互联网 发布:php危险函数 编辑:程序博客网 时间:2024/05/17 04:22
一、在配置文件中(/etc/bashrc 或者 /etc/profile 或者~/.bash_profile 或者 ~/.bashrc)添加如下配置
HISTFILESIZE=4000 #默认保存命令是1000条,这里修改为4000条HISTSIZE=4000USER_IP=`who -u am i 2>/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'` #取得登录客户端的IPif [ -z $USER_IP ]then USER_IP=`hostname`fiHISTTIMEFORMAT="%F %T $USER_IP:`whoami` " #设置新的显示history的格式export HISTTIMEFORMAT
二、加载配置
[root@linux-node ~]# source /etc/bashrc
三、最终显示效果如下
阅读全文
0 0
- Linux 配置 history 命令显示操作时间、用户和登录 IP
- ubuntu History命令显示操作时间、用户和登录IP
- linux history 记录 时间 ip 登录用户
- Linux 给History命令加上时间和IP显示
- linux中history命令显示操作执行的时间配置
- linux中history命令显示操作执行的时间配置
- linux的history命令显示操作用户、显示操作时间、命令
- history显示时间、IP、用户
- [Linux] Linux/Mac OS history命令 添加时间,用户,ip
- Linux下查看用户登陆后的操作记录及history命令显示时间
- Linux下查看用户登陆后的操作记录及history命令显示时间
- Linux下查看用户登陆后的操作记录及history命令显示时间
- history命令显示操作时间
- CentOS-解决CentOS 7 history命令不显示操作记录的时间和用户身份问题
- history添加具体用户-IP-操作时间
- Linux——给history命令加上用户和时间
- Linux history时间用户ip设置
- Linux history时间用户ip设置
- 005--Easyui的datagrid实现宽度自适应
- Linux公社(LinuxIDC)交流社区 http://www.linuxidc.com/
- MySQL触发器增删改实例
- 2.USRP的配置
- 格式化namenode时:SHUTDOWN_MSG: Shutting down NameNode at java.net.UnknownHostException: xxx
- Linux 配置 history 命令显示操作时间、用户和登录 IP
- 【AI World 2017世界人工智能大会TOP 10榜单揭晓】巨星谷歌领衔,中国企业雄起,胡郁等感言
- AAA
- apend后指点元素无法绑定事件问题
- nhmicro的dao层工具技术说明
- display, position和float的关系
- iOS下拉刷新、上拉加载、仿微信提醒框、AR、波浪动画等源码
- Java基础学习笔记13——(StringBuffer的使用,数组高级,Arrays工具类,Integer和Character等包装类)
- (POJ1860)兑换货币