Use the previous command in Linux to reduce keyboard input
Source: Internet
Author: User
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 on the terminal that can improve our efficiency? How programmers work... information & use the previous command to reduce keyboard input and reduce keyboard input on Linux terminals 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 indicates the part of the previous command, starting from 0, 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 :!!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.