Posts

Showing posts from February, 2021

Command History Searching

Image
Using this trick you can speed up a lot your work at command line in Linux (and not only). Pressing Ctrl + R allows you to quickly find a previously used command. How to use it? In command line terminal press Ctrl + R . Start typing some part of command, for example `pul`: (reverse-i-search)`pul': git pull If you want to find a next match, press Ctrl + R again (repeat until successful). If you want to edit the current match press LEFT or RIGHT and edit the command. If you want to exit without running any command, press Ctrl + G . If command you need is displayed, press ENTER to run it. Useful shortcuts These shortcuts are not related to the bash history tool (Ctrl+R), but may be useful if you edit a found command. Ctrl + LEFT/RIGHT - jump over the words. Ctrl + A - move the cursor to the beginning of the line. Ctrl + E - move the cursor to the end of the line. Ctrl + U - remove the content from the be