系統管理
1753331 會員
5373 線上
108792 解決方案
發表新文章

請問有支援 shell history 功能的工具嗎?

 
watermelonyu
教授

請問有支援 shell history 功能的工具嗎?

HP-UX 有像是 bash 支援 shell history 的功能嗎?

就像是 DOS 下的 doskey 工具一樣,可以記憶前幾次輸入的 shell command ?
3則回覆 3
watermelonyu
教授

請問有支援 shell history 功能的工具嗎?

如果你用的是KSH



root@SD /> ksh

# stty erase

# set o=vi

# whoami

root

# pwd

/

#



你可用set o=vi, 此行也可定義在.profile裡面, 然後你就可以使用ESC+K(往前), 或ESC+J(往後)切換使用過的指令.
watermelonyu
教授

請問有支援 shell history 功能的工具嗎?

剛剛忘了,



你也可以用`history`或`fc -l` 列出之前敲過的指令.
watermelonyu
教授

請問有支援 shell history 功能的工具嗎?

Hi :



The posix shell (/usr/bin/sh) is the default luser's login shell.

Set up the follows in ~/.profile



EDITOR=vi

export EDITOR



will let you access the command buffer by vi syntax, such as ESC k for last line, ESC j for next line.



More environment can control the command history file, such as

HISTFILE for name of command history file.

HISTSIZE for the size of history file.



For more detail, please reference man page by

$ man sh-posix



..

.