回答:
私は同じことを試みましたが、卑劣なUbuntuは~/.bashrc
デフォルトでこれらの変数を設定し、~/.profile
ターミナルウィンドウを開くなどの非ログインシェルの代わりに実行されます。これらの行を変更して~/.bashrc
修正しました:
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
/etc/bash.bashrc
あなたに受け入れられるなら、書くことで修正できます。下記参照。(多分それはまた、行方不明になったexport
)
HISTSIZE
The maximum number of commands to remember on the history list.
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).
したがって、無限の履歴リストの場合、
HISTSIZE =(0未満の数値)を作成します。
HISTFILESIZE
The maximum number of lines contained in the history file.
When this variable is assigned a value,
the history file is truncated, 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.
したがって、無限の.bash_history
履歴ファイルの場合、
HISTFILESIZE =(0未満の数値)を作成します。
@Michal Przybylowiczが述べたように、これらのファイルはXubuntu(およびLubuntu)では時々無視されるようです。もしそうなら、代わりに行を書くことができます
export HISTSIZE=10000 export HISTFILESIZE=10000
へ/etc/bash.bashrc
。これにより、これらの環境変数の値がグローバルに変更されます。
export HISEFILESIZE=10000
あなたはあなたにいなかったようですが.profile
)。誰かがそれをここで見た場合に備えて、そうすべきですHISTFILESIZE