Last active
April 16, 2018 16:59
-
-
Save BruceZu/a191c8450d745a28bf0c7708ad93d503 to your computer and use it in GitHub Desktop.
Command Keyboard Shortcuts hotkeys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Linux | |
https://www.computerhope.com/ushort.htm | |
Vim | |
https://www.maketecheasier.com/vim-keyboard-shortcuts-cheatsheet/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unix and Linux shortcut keys
The Super key is usually the key with the Windows logo
alt+f1 opens the system menu. Then you navigate with the arrow keys and select with the Return key.
alt+f2 opens a command launcher. it doesn't tie up a terminal
alt+f4 closes the focused window.
shift+del permanently deletes a file
alt+mouse grabs a window anywhere
ctrl+alt+l locks the screen.
ctrl+backspace ==deletes an entire word== in many text editors.
ctrl+z is undo, and ctrl+shift+z is redo.
ctrl+a selects all, ctrl+c copies the selection, ctrl+x cuts, and ctrl+v pastes.
shift+arrow keys selects,
crtl+right-left arrow keys moves the cursor a word at a time.
crtl+up-down arrow keys either scrolls up and down a line at a time without moving the cursor, or moves the cursor a line at a time, depending which application you're using.
Unix style of copy-and-paste: selecting text copies it and middle-click pastes it, and the copied text stays in the buffer until it is overwritten with a new selection.
Print Screen button takes a screenshot of your entire desktop
alt+prtsc in GNOME 3 takes a screenshot of the ==active window==. or with shutter as editor
F11 toggles the fullscreen view in a lot of applications, for example Firefox, Chrome, Gedit, and Gimp. But not in most KDE4 applications.
ctrl+double-click selects arbitrary words.
Ctl + Alt + Backspace
when X isn't responding or a program has locked up your desktop and you can't get anything to respond. This combination instantly logs you out of X, taking you back to the login screen.
Ctrl + Alt + Delete
reboot, All data will be lost, so use it wisely.
Alt + Tab
cycle through all open windows
*Ctrl + Alt + F **
It switches to various virtual terminals. The default terminal you're working in is 6 or 7. if you already have a graphical interface going, you'll only be able to work in a text-based terminal window. This is really good for debugging problems with the desktop or killing frozen applications when you don't want to kill X completely.
Alt + Arrow key
If you're using Linux, you probably know about the pager that allows you to have multiple desktops at one time. Instead of having to move your mouse to the edge of a screen, you can hit Alt and either the left or right arrow key to move from one desktop to another.
Screen
Ctrl + - Zoom in
Ctrl + Shit + + Zoom out
Ctrl +0 Zoom normal size
Command Editing Shortcuts
move to end of start
move a word
delete line from cursor
Ctrl + k – delete from ==curso==r to the end of the command line -->
Ctrl + u – delete from cursor to the start of the command line <---
Ctrl + y – ==paste== word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor
**Ctrl+Shift+ - ** undo edit
**Ctrl+ 7 ** undo edit
delete word from cursor
delete character from cursor
Ctrl + d – delete character under the cursor. OR close terminal if not in line -->
Ctrl + h – delete character before the cursor <---
upper/lower case
swap
Alt + t – swap current ==word== with previous
Ctrl + t – swap ==character== under cursor with the previous one
Command Recall Shortcuts
Ctrl + r – search the history backwards
Ctrl + g – escape from history searching mode
Type something, then pressing Ctrl-p(or Ctrl-n) will initiate the search in the history with the already typed text as prefix
so you can use up and down arrows, as expected.
standard in ZSH?
Ctrl + p – previous command in history (i.e. walk back through the command history)
Ctrl + n – next command in history (i.e. walk forward through the command history)
Alt + . – use the last word of the previous command
CTRL+o after picking a command from your history, the command is executed, and the next command from history is prepared on the prompt.
Command Control Shortcuts
Ctrl + l – clear the screen
Ctrl + s – stops the output to the screen (for long running verbose command) it is a feature of Unix terminals in general that have the “stty ixon” mode established. You can check whether it is on by typing “stty -a” and can turn it off with “stty -ixon.” I leave it turned off in my .profile, because letting the terminal intercept “Ctrl-s” never lets Bash see it, and it is one of Bash's most useful readline features: “Ctrl-s” searches FORWARD through your history, so that after you have started a search with “Ctrl-r” and looked back through a few matching commands, you can hit “Ctrl-s” to start cycling forward back through the matches. You can “Ctrl-r” and “Ctrl-s” to your heart's content until you're sure you've found the version of the command you want. But only if you remember to “stty -ixon”!
Ctrl + q – allow output to the screen (if previously stopped using command above)
Ctrl + c – terminate the command
Ctrl + z – suspend/stop the command This will zombie an application. If you have a process running in a terminal and you want the terminal back but don't want to kill the application, you can hit Ctrl + z to send the process to the background. To get the process back, type fg.
Bash Bang (!) Commands
Bash also has some handy features that use the ! (bang) to allow you to do some funky stuff with bash commands.
**!! **– run last command
$ git log $ !!:s/log/s git s
!?
$ grep -rR fpc fpc-log.txt fpc $ !!:gs/fpc/foo/ grep -rR foo foo-log.txt foo
$ grep -rR fpc fpc-log.txt fpc $ !!:s/fpc/foo/ grep -rR foo fpc-log.txt
!$ – the last word of the previous command (same as Alt + .)
!$:p – print out the word that !$ would substitute
!* –gives you all the arguments passed,
!*:p – print out what !* would substitute
If you type a command and run it, you can re-run the same command but substitute a piece of text for another piece of text using ^^ e.g.:
!:0
Vim
**:cq ** cancel an editing session
IDEA
Git