リバース検索のために、bashでカスタムコマンド履歴ファイルを繰り返します。

リバース検索のために、bashでカスタムコマンド履歴ファイルを繰り返します。

実行されたすべてのコマンドをいくつかの形式でファイルに~/.bashrc追加する行をファイルに追加しました。たとえば、次のようになります。~/.bash_eternal_historydate directory history-number command

 2019-01-08.23:59:32    /home/sport/Desktop   745  pwd

キーワードを検索するか、キーを使用して各結果を1つずつ循環させるには、reverse-i-searchカスタム履歴ファイルからコマンドを呼び出す機能が必要です。~/.bash_eternal_historyupdown

どうすればいいですか?

ベストアンサー1

これは以下に由来していますman bash

   HISTFILE
          The name of the file in which command history is saved (see HISTORY below).  The default  value  is
          ~/.bash_history.  If unset, the command history is not saved when a shell exits.
   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 remov‐
          ing  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.

おすすめ記事