以非 root 用户使用终端快捷方式

Using terminal shortcuts with a non-root user

我已将非 root 用户添加到我的 Linux os 以用于我的日常需要。但是,我无法使用习惯的快捷方式。

要使用我以前的代码,我通常按 UPDOWN 我键盘上的按钮。现在使用非 root 用户,它显示

$ ^[[A  // When I press UP arrow
$ ^[[B   // or DOWN arrow and so on...

Why a nonroot user cannot use shortcuts and how can I use them

看起来您的默认 shell 不是 bash。 您可以通过 运行 (当不是 root 时)

检查它
echo $SHELL

ps -p `echo $$`

我最好的猜测是 ksh。

您不必使用 bash - 但大多数人都在使用它,因为它对用户最友好并且应该适用于所有发行版。

还有其他 shells - ksh、csh、tcsh、zsh 或 fish。 最后两个是 bash.

的不错替代品