역방향 검색을 위해 bash에서 사용자 정의 명령 기록 파일을 반복합니다.

역방향 검색을 위해 bash에서 사용자 정의 명령 기록 파일을 반복합니다.

실행된 모든 명령을 일부 형식으로 파일에 ~/.bashrc추가하는 행을 파일에 추가했습니다 . 예를 들면 다음과 같습니다.~/.bash_eternal_historydate directory history-number command

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

키워드를 검색하고 또는 키를 사용하여 각 결과를 하나씩 순환하려면 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.

관련 정보