首页 » ORACLE 9i-23ai » Utilities-rlwarp, how to clear history command? do it

Utilities-rlwarp, how to clear history command? do it

rlwarp是个非常好的工具,可以以行为单位记录操作的历史记录,比如在sqlplus ,rman,ggsic等不支持上下键的操作时非常有用,之前我有写过怎么安装,去右上角搜索,比如你想清除它的历史记录怎么办呢?

配置是比如
rlwarp sqlplus / as sysdba,实际执行的是sqlplus,可以安up down方向键查看历史,按ctrl + u 或 ctrl + w 删当前命令记录,还可以搜索
等等

可以指定下面的环境变量改变历史文件的记录位置
Environment

RLWRAP_HOME:
directory in which the history and completion files are kept.
RLWRAP_EDITOR (or else EDITOR, or else VISUAL):
editor to use for multi-line input. Example:

export RLWRAP_EDITOR=”microemacs -l%L:%C”
export RLWRAP_EDITOR=”vi +%L”

The last example is the default; %L and %C are replaced by line and column numbers corresponding to the cursor position in rlwrap’s edit buffer

RLWRAP_FILTERDIR:
Any executable along your PATH can in theory be used as a filter, but because filters have to follow a rather outlandish protocol (cf. RlwrapFilter (3)) it is a good idea to keep them separate. This is why rlwrap adds a special filter directory to $PATH just before launching a filter. By default, this is /usr/share/rlwrap/filters, but $RLWRAP_FILTERDIR is used if set.

如果没有指定,LINUX下历史文件记录在用户的HOME下。
[oracle@dbserver1 ~]$ ll -a
total 4873460
drwx—— 7 oracle oinstall 4096 Jun 8 17:21 .
drwxr-xr-x 5 root root 4096 May 25 05:00 ..
-rw——- 1 oracle oinstall 11586 Jun 5 14:52 .bash_history
-rw-r–r– 1 oracle oinstall 33 May 25 05:00 .bash_logout
-rw-r–r– 1 oracle oinstall 1475 May 31 14:20 .bash_profile
-rw-r–r– 1 oracle oinstall 124 May 25 05:00 .bashrc
-rw-r–r– 1 oracle oinstall 515 May 25 05:00 .emacs
-rw——- 1 oracle oinstall 706 Jun 8 17:03 .ggsci_history
drwxr-xr-x 3 oracle oinstall 4096 May 25 05:00 .kde
drwxr-xr-x 4 oracle oinstall 4096 May 25 05:00 .mozilla
-rw——- 1 oracle oinstall 1794 Jun 8 17:18 .sqlplus_history

可以看到sqlplus,ggsic的历史记录都在文件中,和操作系统是一个原理.bash_history 就是os的bash的操作记录历史。

打赏

对不起,这篇文章暂时关闭评论。