ใช่man bash
พูดว่า:
HISTSIZE - จำนวนคำสั่งที่ต้องจดจำในประวัติคำสั่ง
แต่มีReadline
ตัวแปรของ:history-size
ตั้งค่าจำนวนรายการประวัติสูงสุดที่บันทึกไว้ในรายการประวัติ หากตั้งค่าเป็นศูนย์รายการประวัติที่มีอยู่จะถูกลบและไม่มีการบันทึกรายการใหม่ หากตั้งค่าเป็นน้อยกว่าศูนย์จำนวนรายการประวัติไม่ จำกัด ตามค่าเริ่มต้นจำนวนรายการประวัติไม่ จำกัด
คุณสามารถตั้งค่าhistory-size
ด้วยHISTSIZE=1000
, bind 'set history-size 1000'
หรือบรรทัดต่อไปนี้ในของคุณ~/.inputrc
:set history-size 1000
ตัวอย่าง :
HISTSIZE=1000
bind 'set history-size 0'
echo $HISTSIZE # prints 1000
bind -v | grep history-size # prints set history-size 0
history # prints nothing
bind 'set history-size 0'
HISTSIZE=1000
echo $HISTSIZE # prints 1000
bind -v | grep history-size # prints set history-size 1000
history # prints 13 echo $HISTSIZE\n14 bind -v | grep history-size\n15 history
history-size
ให้บริการตั้งแต่bash-4.0-alpha
: เปลี่ยน