Using the previous command on a Linux terminal to reduce keyboard input and keyboard input can greatly improve the efficiency of programmers. The use of shortcut keys is a good example. Programmers often use terminals. Is there a similar "shortcut key" on the terminal that can improve our efficiency? The programmer's work is often related to the front and back. Therefore, this article demonstrates how to use the previous command to improve work efficiency. 1. Use all the parameter methods of the previous command :! * Example: If I edit hello.txtand bye.txt, I want to use git add to add these two files. You can use: git add! * 2. Use the last parameter method of the previous command :! $ ALT +. ESC +. The following two methods are provided. terminal will automatically complete 3. Use the methods except the last parameter in the previous command :! -: Example: I personally think this is useful, because some commands will input a lot of options, and the last one is the object that actually works. If you enter the option again, it will be troublesome. 4. Use any part of the method in the previous command: ALT + <num> +. The Nth part of the previous command indicated by num starts from 0 and is used for ls-shld hello.txt. ALT + 0 +. Is ls. 1 is-shld 5. replace one of the methods in the previous command: replace foo with bar ^ foo ^ bar with only one !! : Gs/foo/bar replace all 6. Previous command method :!!