linux中Shell历史命令记录文件的路径是什么

第一步: 
“/etc/profile”文件中的“HISTFILESIZE”和“HISTSIZE”行确定所有用户的“.bash_history”文件中能保
存的旧命令条数。强烈建议把把“/etc/profile”文件中的“HISTFILESIZE”和“HISTSIZE”行的值设为一个较小的数,比如
30。编辑profile文件(vi /etc/profile),把下面这行改为: 
HISTFILESIZE=30 
HISTSIZE=30 
这表示每个用户的“.bash_history”文件只能保存30条旧命令。 
第二步: 

网管还应该在"/etc/skel/.bash_logout" 文件中添加下面这行"rm -f $HOME/.bash_history" 。这样,当用户每次注销时,“.bash_history”文件都会被删除.



本文转自 Lee_吉  博客,原文链接:   http://blog.51cto.com/12173069/2052374     如需转载请自行联系原作者

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
可以记录常用的linux命令,特别是比较长的,非常有用。使用方法:把该Q可执行文件考备份到linux上,任何目录都行,第一次执行用./q的方式执行,第一次执行之后q程序会被加到系统目录,以后每次执行都可以像使用系统命令一样。例如 1.查看保存过的命令 [root@localhost ~]# q 1_____clear 2_____tar -xzvf 3_____tar -czvf 4_____rpm -ivh 5_____lsnrctl status 6_____lsnrctl start 7_____lsnrctl stop 8_____vi /home/oracle/ora/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 9_____/opt/lampp/lampp start 10_____/opt/lampp/lampp restart 11_____/opt/lampp/lampp stop 2.添加新命令 [root@localhost ~]# q -a "sqlplus /as sysdba" 1_____clear 2_____tar -xzvf 3_____tar -czvf 4_____rpm -ivh 5_____lsnrctl status 6_____lsnrctl start 7_____lsnrctl stop 8_____vi /home/oracle/ora/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 9_____/opt/lampp/lampp start 10_____/opt/lampp/lampp restart 11_____/opt/lampp/lampp stop 12_____sqlplus /as sysdba 3.删除命令 [root@localhost ~]# q -d 12 1_____clear 2_____tar -xzvf 3_____tar -czvf 4_____rpm -ivh 5_____lsnrctl status 6_____lsnrctl start 7_____lsnrctl stop 8_____vi /home/oracle/ora/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora 9_____/opt/lampp/lampp start 10_____/opt/lampp/lampp restart 11_____/opt/lampp/lampp stop 4.执行保存过的命令 [root@localhost ~]# q 10 Stopping XAMPP for Linux 1.8.1... XAMPP: Stopping Apache with SSL... XAMPP: Stopping MySQL... XAMPP: XAMPP-ProFTPD is not running. XAMPP stopped.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值