一. 退格键的问题
如果退格键不能用,可以使用stty命令来解决。该命令可以改变并打印终端行设置。
以前整理的Blog:
stty 命令
http://blog.csdn.net/tianlesoftware/archive/2010/03/15/5381984.aspx
看这个命令的帮助:
[oracle@singledb ~]$ stty --help
Usage: stty [-F DEVICE] [--file=DEVICE] [SETTING]...
or: stty [-F DEVICE] [--file=DEVICE] [-a|--all]
or: stty [-F DEVICE] [--file=DEVICE] [-g|--save]
Print or change terminal characteristics.
-a, --all print all current settings in human-readable form
-g, --save print all current settings in a stty-readable form
-F, --file=DEVICE open and use the specified DEVICE instead of stdin
--help display this help and exit
--version output version information and exit
Optional - before SETTING indicates negation. An * marks non-POSIX
settings. The underlying system defines which settings are available.
Special characters:
* dsusp CHAR CHAR will send a terminal stop signal once input flushed
eof CHAR CHAR will send an end of file (terminate the input)
eol CHAR CHAR will end the line
* eol2 CHAR alternate CHAR for ending the line
erase CHAR CHAR will erase the last character typed
intr CHAR CHAR will send an interrupt signal
kill CHAR CHAR will erase the current line
* lnext CHAR CHAR will enter the next character quoted
quit CHAR CHAR will send a quit signal
* rprnt CHAR CHAR will redraw the current line
start CHAR CHAR will restart the output after stopping it
stop CHAR CHAR will stop the output
susp CHAR CHAR will send a terminal stop signal
* swtch CHAR CHAR will switch to a different shell layer
* werase CHAR CHAR will erase the last word typed
....
Handle the tty line connected to standard input. Without arguments,prints baud rate, line discipline, and deviations from stty sane. In settings, CHAR is taken literally, or coded as in ^c, 0x37, 0177 or 127; special values ^- or undef used to disable special characters.
Report bugs to <bug-coreutils@gnu.org>.
[oracle@singledb ~]$
与退格键相关的设置是erase,它表示删除最后一个字符。
$stty erase ^H
说明:按下退格键会显示成^H
如果在当前窗口执行的话,只对当前的窗口有效,下次登陆的时候还需要重新设置,可以把这个命令写入shell 的配置文件,如~/.bashrc 中,这样每次都能生效了。
二. 方向键的问题
WIN 下使用方向键是没有问题的,但是在Linux下,方向键是使用不了了。 可以安装一下rlwrap 工具。
rlwrap本身是个遵循GPL 标准的Shell 脚本,可以运行任何你提供给它的命令包括参数,并添加命令历史浏览功能。
可以在http://rpm.pbone.net/ 上搜到这个工具的RPM包。
http://rpm.pbone.net/index.php3/stat/4/idpl/14484200/dir/redhat_el_5/com/rlwrap-0.3
7-1.el5.i386.rpm.html
[root@singledb mnt]# rpm -ivh rlwrap-0.37-1.el5.i386.rpm
warning: rlwrap-0.37-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6
Preparing... ########################################### [100%]
1:rlwrap ########################################### [100%]
[oracle@singledb ~]$ rlwrap sqlplus / as sysdba;
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Feb 3 15:13:13 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> select * from v$version;
现在就可以上下翻动了。 但是这样没事都需要加上rlwrap 也是很麻烦的,可以对rlwrap 做一个别名,放到shell 的配置文件里,在~/.bashrc 文件里添加如下内容:
alias sqlplus='rlwrap sqlplus'
[oracle@singledb ~]$ cat ~/.bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
alias sqlplus='rlwrap sqlplus'
[oracle@singledb ~]$
[oracle@singledb ~]$ source ~/.bashrc --让参数生效
[oracle@singledb ~]$ sqlplus / as sysdba; -- 然后就可以正常使用sqlplus了
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Feb 3 15:18:07 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL>
其他一些组合键:
Ctrl+A:ahead,到行的顶端,相当于 Home
Ctrl+E:end,到行的末端,相当于end
Ctrl+B:behind,后退一个字符,相当于left
Ctrl+F:forward,前进一个子放入,相当于right
Ctrl+P:prev.,上一行历史记录,相当于up
Ctrl+N:next.,下一行历史记录,相当于down
Ctrl+U:undo,回复操作,这行就被清空掉了
Ctrl+W:剪切
Ctrl+Y:粘贴
Ctrl+L:cLear,清屏
整理自网络
------------------------------------------------------------------------------
Blog: http://blog.csdn.net/tianlesoftware
网上资源: http://tianlesoftware.download.csdn.net
相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
DBA1 群:62697716(满); DBA2 群:62697977(满)
DBA3 群:62697850 DBA 超级群:63306533;
聊天 群:40132017
--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请
分享到:
相关推荐
包含termcap-1.3.1.tar.gz,readline-6.2.tar.gz,rlwrap-0.37.tar.gz包 libtermcap-2.0.8-47.i386.rpm readline-devel-5.2-13.fc9.i386.rpm...按照里面说明文档操作即可,可以解决sqlplus下面退格,方向键输入乱码问题
Linux下sqlplus退格、上翻键乱码工具,包含安装说明
linux下用sqplus调试oracle时,常常会输错命令,但是删除键及方向键不能使用。此软件可以完美解决此问题。
linux优化sqlplus方向键
下载完成后在Linux系统下解压、编译、安装。
在sqlplus中,方向键输出的都是乱码,安装这个软件以后,就可以正常使用方向键了。
linux下sqlplus历史命令回调问题 linux下sqlplus历史命令回调问题 linux下sqlplus历史命令回调问题 linux下sqlplus历史命令回调问题 linux下sqlplus历史命令回调问题 linux下sqlplus历史命令回调问题
面试中Linux中SQLplus上下键不能显示历史命令的问题
主要介绍了Linux中Oracle的sqlplus下退格和Del键无效的问题解决,修复使用时在命令行界面下产生乱码的问题,需要的朋友可以参考下
解决sqlplus 删除键,方向键扥乱码
可以让linux环境下的sqlplus自由翻页的工具集合
有文档,告诉你怎么做了,照着文档做就可以了
Linux Oracle下sqlplus无法使用命令退格删除和历史记录的解决方法(使用rlwrap) 附件中有解决方法的具体步骤
详细介绍了 linux下安装sqlplus的过程,包括安装包下载,环境变量配合等
Linux环境下安装SQLplus的必备rpm包,包含两个版本,Oracle 11g和Oracle 12cR2,还有详细安装教程,亲测好用,感谢您的下载!
主要介绍了Linux下Oracle中SqlPlus时上下左右键乱码问题的解决办法,非常不错,具有参考借鉴价值,需要的朋友可以参考下
Linux下面使用sqlplus热键冲突 解决方案包中包括:libtermcap-devel-2.0.8-46.1.i386.rpm rlwrap-0.42.tar.gz readline-devel-5.1-1.1.i386.rpm
rlwrap软件 内含安装txt 解决linux环境下sqlplus不能前进后退问题,方便在sqlplus环境下轻松解决输入问题。
安装方法: 1. tar -jxvf rlwrap-0.28.tar.bz2 2. cd rlwrap-0.28 ...alias sqlplus='rlwrap sqlplus' rlwrap is a 'readline wrapper' that uses the GNU readline library alias rman='rlwrap rman'