यह bashइतिहास का विस्तार है, उदाहरण के लिए
!87
हिस्ट्री लाइन से कमांड को फिर से निष्पादित करता है 87।
आप इस सुविधा का वर्णन man bash"खंड सूची" खंड में पाते हैं :
An event designator is a reference to a command line entry in the
history list. Unless the reference is absolute, events are relative to
the current position in the history list.
! Start a history substitution, except when followed by a blank,
newline, carriage return, = or ( (when the extglob shell option
is enabled using the shopt builtin).
!n Refer to command line n.
!-n Refer to the current command minus n.
तो जल्दी से अंतिम कमांड को कॉल करें, करें !-1और पांचवें अंतिम कमांड के लिए !-5। इसके लिए एक पर्यायवाची पर्यायवाची !-1है !!- यदि आप उदाहरण के लिए कॉल करते हैं apt install somethingऔर भूल जाते हैं sudo, तो निष्पादित करें sudo !!और आप अच्छे हैं।
केवल बैकस्लैश ( \ ) और एकल उद्धरण इतिहास विस्तार वर्ण को उद्धृत कर सकते हैं।
इतिहास विस्तार से बचने के लिए, आपको बैकस्लैश ( \!) के साथ विस्मयादिबोधक चिह्न से बचने या एकल उद्धरण ( '!') का उपयोग करने की आवश्यकता है ।