FreeBSD 11でCLI履歴を設定する

FreeBSD 11でCLI履歴を設定する

$HOME/.profile環境変数の定義に従ってENV設定されます。私の殻は。$HOME/.shrcexport ENVecho $0-sh

$HOME/.shrcHISTFILEおよびHISTSIZE変数宣言から:

HISTFILE=$HOME/.sh_history
HISTSIZE=500
export HISTFILE
export HISTSIZE

ただし、再起動後、利用可能な履歴はありません。

編集する:

歴史

 A sh command, the Thompson   shell, appeared in Version 1 AT&T UNIX.  It
 was superseded in Version 7 AT&T UNIX by the Bourne shell,   which inher-
 ited the name sh.

 This version of sh   was rewritten in 1989 under the BSD license after the
 Bourne shell from AT&T System V Release 4 UNIX.

作家

 This version of sh   was originally written by Kenneth Almquist.

ベストアンサー1

rootアカウントのデフォルト値は、「history」エイリアス/コマンドを使用するtcshです。特に指定がない限り、shはユーザーのデフォルト値です。 shの書き込みコマンドの実際のバイナリは次のとおりです。

/usr/bin/fc 

-lフラグと、つまりfc -l

また見てくださいman history

おすすめ記事