Linuxでは一般的に多くのコマンドを使用するので、すべて覚えにくいです。
history
Commandsは以前に使用したコマンドのリストを提供しますが、制限は少なくなります。新しいコマンドが古いコマンドを上書きすると、古いコマンドは失われます。コマンドログがシステムのどこかに保存されているようです。
ログを開いて読むことができますか?可能であれば、処理できる最大ログサイズを変更できますか?
コマンドの出力はhistory
ログインしているユーザーによって異なりますか?
ベストアンサー1
簡単な解決策は、保存され返されるコマンドの数を増やすことですhistory
。 Bashを使用している場合は、次の行を次の行に追加してください~/.profile
。
export HISTSIZE=100000
export HISTFILESIZE=999999
からman bash
:
HISTFILESIZE
The maximum number of lines contained in the history file. When
this variable is assigned a value, the history file is trun‐
cated, if necessary, to contain no more than that number of
lines by removing the oldest entries. The history file is also
truncated to this size after writing it when a shell exits. If
the value is 0, the history file is truncated to zero size.
Non-numeric values and numeric values less than zero inhibit
truncation. The shell sets the default value to the value of
HISTSIZE after reading any startup files.
HISTSIZE
The number of commands to remember in the command history (see
HISTORY below). If the value is 0, commands are not saved in
the history list. Numeric values less than zero result in every
command being saved on the history list (there is no limit).
The shell sets the default value to 500 after reading any
startup files.