Linux历史命令的调用

历史命令

命令:history [选项][历史命令保存文件]

选项: -c :清空历史命令

-w:把缓存中的历史命令写入历史命令保存文件~/.bash_history

注:历史命令默认会保存1000条,可以在环境变量配置文件/etc/profile中修改;

 

历史命令的调用

1. 使用上下箭头调用以前的历史命令

2. 使用!n重复执行第n条历史命令

3. 使用“!!”重复执行上一条命令

4. 使用“!字串”重复执行最后一条以该字串开头的命令

 

命令与文件的补全

bash中,命令与文件全是非常方便与常用功能,我们只要在输入命令或文件时,按“tab”键就会自动进行补全;

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
保存和执行常用的linux命令,经常需要编辑的目录很深的文件,或教长的编译命令等等。使用方法:把该Q可执行文件考备份到linux上任何目录,第一次执行会被加到系统目录,以后每次执行都可以像使用系统命令一样。 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 10 Stopping XAMPP for Linux 1.8.1... XAMPP: Stopping Apache with SSL... XAMPP: Stopping MySQL... XAMPP: XAMPP-ProFTPD is not running. XAMPP stopped. 3.添加新命令 [root@localhost ~]# q -a "sqlplus /sys as dba" 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 /sys as dba 4.删除保存过的命令 [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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值