安装rlwrap解决方向键和退格键失效

本文介绍如何在CentOS 7上安装rlwrap包,并通过它增强Sqlplus等命令行工具的功能,实现输入历史记录和编辑等功能。rlwrap利用GNU readline库提供强大的交互式命令行体验。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

需要安装一个 rlwrap 包。 rlwrap是一个基于GNU readline library的工具,可以增强Linux中的Sqlplus命令行功能,
能够使一些普通的命令行(比如Oracle中的Sqlplus、Rman等)具有历史输入回溯和错误回退修正的增强功能。 
下载完rpm安装包后,以root用户进行安装。


在安装rlwrap前,要先安装readline, readline-devel, libtermcap, libtermcap-devel

可用命令“rpm -qa | grep 程序名”来查找某个程序是否已安装


1、下载地址: (For  CentOS7)
http://rpm.pbone.net/index.php3/stat/4/idpl/30448081/dir/centos_7/com/rlwrap-0.42-1.1.x86_64.rpm.html

选择其他适合版本:
http://rpm.pbone.net/index.php3?stat=3&search=rlwrap&srodzaj=3



基本信息如下:
rlwrap rpm build for : CentOS 7

Name :  rlwrap-0.42-1.1.x86_64.rpm
Version : 0.42 Vendor : obs://build_opensuse_org/home:Ledest:misc
Release : 1.1 Date : 2015-01-11 17:25:51
Group : Productivity/Other Source RPM : rlwrap-0.42-1.1.src.rpm
Size : 0.17 MB 
Packager : (none) 
Summary : A Readline Wrapper
Description : 
rlwrap uses the GNU readline library to allow the editing of keyboard input for
any other command. The input history is remembered across invocations, separately
for each command;history completion and search work as in bash and completion
word lists can be specified on the command line.

RPM found in directory: /mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/Ledest:/misc/CentOS_7/x86_64

Content of RPM  Changelog  Provides Requires
Download 
ftp.gwdg.de rlwrap-0.42-1.1.x86_64.rpm
ftp.pbone.net rlwrap-0.42-1.1.x86_64.rpm

2、以root用户进行安装
此RPM 包 可以直接安装,不需要其他依赖包。



3、使用方法

rlwrap sqlplus 

也可将其添加到别名中   
编辑oracle用户下的.bash_profile 
增加以下两行:

alias sqlplus=’rlwrap sqlplus’ 
alias rman=’rlwrap rman’


备注:如果修改.bash_profile不能正常使用,请修改 .bashrc(通常这2个文件在/home/oracle下)

保存退出后执行以下命令立即启用即可。  
.  .bash_profile
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值