When you search in history with CTRL+r and that multiple occurences are found, press CTRL+r repeatedly to switch between them. The search is from the most recent to the oldest.
When writing a command, you can insert the first word of the previous command executeda. for that :
ALT + . ← Recall the first word of the previous command
It is possible to delete a character before or after the cursor with the shortcuts :
CTRL + D | Delete the current character and, if the line is blank, close the terminal |
CTRL + H | Delete the character which is before the cursor |
These functions are also available for delete the words and the lines :
ALT + D | Delete the word at right of cursor, or the rest of word from cursor and towards right |
CTRL + W | Delete yhe word at left of cursor, or the rest of word towards left |
CTRL + K | Delete from cursor until the end of command |
CTRL + U | Delete from cursor until start of command |
Note that words or lines deleted with previous commands will be in the Bash clipboard.
This clipboard is different that the one in the desktop, with which he doesn't communicate !
When you fill the clipboard, he does not forget what he contains. Everything is kept in memory and you can choose what you want to paste.
The shortcuts of clipboard of Bash are :
CTRL + Y | Paste the last element into the clipboard, deleted by CTRL+U, CTRL+W ou CTRL+K |
ALT + Y | After using CTRL+Y, invert the text pasted with what was previously in the clipboard |
Bash also allows you to swap two letters or two words :
CTRL + T | Invert the letter under cursor with the one that precedes it |
ALT + T | Same, with 2 words |
Finally, it is possible to transform the case of a word :
ALT + U | Convert a word in uppercase, from the cursor |
ALT + L | Convert a word in lowercase, from the cursor |
ALT + C | Capitalize a word (the first letter of word in uppercase) |
COPY/PASTE
CTRL + SHIFT + C | Copy |
Select the text | Copy |
CTRL + SHIFT + V | Paste |
click with the mouse wheel | Paste |
CANCEL
There are 2 shortcuts to cancel :
CTRL + / | Undo the last action (equivalent to CTRL+Z) |
CTRL + G | Leave a search into historic |
MANAGE THE PROCESSES
When a process is started in the foreground from Bash, the following shortcuts are available :
CTRL + C | Finish the process. Do not worry, he will not suffer ;) |
CTRL + Z | Pause the process. Can be revived in the foreground or background with the commands "fg" or "bg". The command "jobs" list the processes in pause. |
CLEAN AND MANAGE THE DISPLAY
It is possible to manipulate what Bash shows on the screen with these three shortcuts :
CTRL + L | Cleans the screen to show only a command prompt blank |
CTRL + S | Stop the display ; very useful when a very verbose program runs |
CTRL + Q | Resumes the display stopped with CTRL+S |
END OF FILE
There is a shortcut to send the EOF (End Of File) character: CTRL + D
If you send this character on a command line, this is equivalent to the exit command.