Thursday, 2 July 2015

Unix and Linux shortcut keys | Basic Important unix and linux Shortcut keys You Should Know

Unix and Linux shortcut keys

I have not seen the hyper key mentioned in a long time, but just like the meta key it can be mapped to other keys. Key mappings are particular to desktop environments, individual applications and command shells, so that's where you look when you're figuring it all out. For example in KDE4 it's System Settings > Shortcuts and Gestures. Look in the Settings Manager in XFCE4, Preferences > Keyboard in GNOME 2, and System Settings > Keyboard > Shortcuts in GNOME 3.

Common Keybindings

These are usually the same in KDE4 and GNOME, and in some other Linux graphical environments, though if you find out differently don't be surprised.
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. This is my favorite because it doesn't tie up a terminal, and it's faster than wading through the system menu. 
alt+f4 closes the focused window.
alt+mouse grabs a window anywhere you want to place the cursor. This is great for dragging back a window that has been moved past the edge of the screen.
shift+del permanently deletes a file without sending it to the Trash.
ctrl+alt+l locks the screen.
alt+tab cycles between open applications.
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, and 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.

More Keyboard Shortcuts

Sadly, the wonderfully useful Unix style of copy-and-paste is inconsistently supported in Linux. When it works right, 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.
Pressing the Print Screen button takes a screenshot of your entire desktop and opens a save dialog in both KDE4 and GNOME 3. alt+prtsc in GNOME 3 takes a screenshot of the active window.
F11 toggles the fullscreen view in a lot of applications, for example Firefox, Chrome, Gedit, and Gimp. But not in most KDE4 applications.
When you want to select multiple files in a file manager the ctrl and shift keys are your friends. To make a consecutive selection first click on a filename, then press the shiftkey and click at the end of your selection. As long as you are pressing the shift key you can select more or fewer files by clicking in different places, or using the arrow keys.
Use ctrl+click to select batches of arbitrary files one at a time, or to add or de-select individual items from a shift+click batch.
ctrl+double-click has special abilities in Firefox and LibreOffice Writer-- you can select multiple arbitrary words on the page (figure 2).
Figure 2: ctrl+double-click selects arbitrary words.
There is probably some documentation for your particular Linux flavor on key mappings, but it's faster and more accurate to look at your keyboard configuration to get the real story.
Quick links


Introduction


Shortcuts are designed to help shorten the time required to perform frequently used commands or actions. In the below sections, we have listed keyboard shortcut keys that can be performed by pressing two or more keys at once. In addition to keyboard shortcut keys, we have also listed command line shortcut keys that can be typed in at the shell.

Tip: Not all of the following shortcut keys and command line shortcuts are universally compatible with every variant of Unix and Linux.

Keyboard shortcut keys


CTRL+BMoves the cursor backward one character.
CTRL+CCancels the currently running command.
CTRL+DLogs out of the current session.
CTRL+FMoves the cursor forward one character.
CTRL+HErase one character. Similar to pressing backspace.
CTRL+PPaste previous line(s).
CTRL+SStops all output on screen (XOFF).
CTRL+QTurns all output stopped on screen back on (XON).
CTRL+UErases the complete line.
CTRL+WDeletes the last word typed. For example, if you typed 'mv file1 file2' this shortcut would delete file2.
CTRL+ZCancels current operation, moves back a directory or takes the current operation and moves it to the background. See bg command for additional information about background.

Command line shortcuts


In addition to the below command line shortcuts, it is also helpful to use the alias commandthat allows you to specify a keyword for frequently used commands or mistakes.

 ~Moves to the user's home directory.
!!Repeats the line last entered at the shell. See history command for previous commands.
!$Repeats the last argument for the command last used. See history command for previous commands.
resetResets the terminal if terminal screen is not displaying correctly.
shutdown -h nowRemotely or locally shuts the system down.

No comments:

Post a Comment