linux下修改history命令保存条数

No Comments IT必备工具

 

linux下修改history只能显示一条的方案

 

显示当前可显示条数

[root@localhost .ssh]# echo $HISTSIZE
1
[root@localhost .ssh]#

临时修改到100条

[root@localhost .ssh]# HISTSIZE=100

[root@localhost .ssh]# echo $HISTSIZE
100

------中间广告---------

永久100条

查看

[root@localhost .ssh]# cat /etc/profile |grep HIST
HISTSIZE=1

修改

[root@localhost .ssh]# vi /etc/profile
刷新配置
source /etc/profile
查看配置
cat /etc/profile |grep HIST
HISTSIZE=100

[root@localhost .ssh]# SDFS
bash: SDFS: command not found
[root@localhost .ssh]# S
bash: S: command not found
[root@localhost .ssh]# DFS
bash: DFS: command not found
[root@localhost .ssh]# DF
bash: DF: command not found
[root@localhost .ssh]# SDF
bash: SDF: command not found
[root@localhost .ssh]# history
   11  HISTSIZE=100
   12  echo $HISTSIZE
   13  SDFS
   14  S
   15  DFS
   16  DF
   17  SDF
   18  history

发表评论