Bash Shortcuts
- clear current line no matter where the cursor is: ctrl+k+u
Ctrl+ a/e | Move the cursor to the beginning/end of the current line |
Ctrl + L | clear the terminal |
Ctrl+ u/k | Remove till the beginning/end |
Ctrl + z | Send the current process to background |
Ctrl + d | Close the bash shell By sending EOF signal |
Ctrl + r | Search the history backwards |
(some prefix) Alt + n | Search the history backwards non-incremental |
up/down | go to previous/next command in history |
Terminal Shortcuts
Alt+1(..9,0) | Switch to tab 1.. 10 |
Shift+PageUp/Down | Go up/down a whole page |
Ctrl+Shift+Up/down | Go up/down by line |
Ctrl+,(or .) | Switch to previous/next tab |
Ctrl+<(or >) | Move tab to left/right |
F11 | Toggle full screen |
Customize Shortcuts for GNOME Terminal
- Go to edit -> Preferences -> Shortcuts
- Ctrl+f to search
- Ctrl+,/. to go to previous/next tab
- Ctrl+Shift+,/. to move to previous/next tab
- Ctrl+t/n to create new tab/window
- Ctrl+w to close tab
Make Ctrl+C/V to copy and paste
- By default, ctrl+c is mapped to interrupt a program, Ctrl+Shift+C/V to copy/paste data.
- We can go to “Edit” -> “Keyboard Shortcuts…”, map Ctrl+C/V to copy/paste, the interrupt command will automatically be remapped to Ctrl + Shift + C.
Middle-click copy-paste
- Select the text and middle click to copy it; then middle click to paste it. This works in all applications.
- The clipboard buffer used for middle-click copy-paste is separate from the one used for Ctrl-C/Ctrl-V, which makes possible to have two different bits of text copied at the same time.
- Useful in Terminal(as in terminal we can only paste at last line), but for other apps, it’s difficult to control where it pastes.
Show menubar again after accidentally unchecked View -> Show Menubar
- Right click anywhere inside the Terminalthen select “Show Menubar”
Terminal Tips
- User
history | grep x | grep y
to find command