Linux.com

Home Learn Linux Linux Tutorials Best Linux Keyboard Shortcuts

Best Linux Keyboard Shortcuts

There you are typing happily away, when all of a sudden you accidentally hit some hotkeys and weird things happen. Linux does not yet have a universal "undo" button, which I think is the most needed feature for any computer, so you have to know what you did so you can undo it. If you don't find the offending keyboard shortcut after reading this article, you'll know where to look to find out how they're configured on your system.

The good news is keyboard shortcuts can speed up your productivity a lot. The bad news is keyboard shortcuts are a moving target on Linux: You'll see different behaviors in different applications, desktop environments, and command shells.

The good news is you can customize them. The bad news is even when you have a central keyboard configuration for your particular desktop environment, many applications can be customized individually.

The good news is that all this flexibility lets you fine-tune your workflow. The bad news is all this flexibility can drive you nuts.

That's enough good-news, bad-news. So let's explore the fine world of keyboard shortcuts on Linux.

What are Meta, Super, and Hyper Keys?

The meta, super, and hyper keys go way, way back to the days of the Space Cadet keyboard, which had keys with those labels. Those days are long gone, but the terminology persists, to the confusion of modern computer users. None of these keys exist on modern keyboards, but are mapped to other keys, such as the Alt key, Windows key, or Ctrl key. Howto authors that refer to the meta key expect that you know which key your particular system has mapped it to.

The Super key is the least ambiguous of the three terms. It is usually the key with the Windows logo, unless you have a proper keyboard with a Linux logo.

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. Keymappings 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. 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.

The shortcut ctrl+double-click selects arbitrary words.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 keymappings, but it's faster and more accurate to look at your keyboard configurator to get the real story.

 

Comments

Subscribe to Comments Feed
  • Edmundo Said:

    Come on, Carla! No alt-sysrq combos? Lame! :-)

  • Carla Schroder Said:

    Next time I'll make some special just for you, Edmundo!

  • Z_God Said:

    I would expect these as well here. I don't know why the article has 'Linux' in its title now, because it's about KDE and Gnome shortcuts which are unrelated to the Linux kernel.

  • Pitch Said:

    Pretty rudimentary. And not specific to Linux, for the most part. Keyboard Shortcuts 101.

  • Topher Said:

    While I did know a good amount of these, there were a few I didn't (like F11 in Firefox!) Thanks Carla!

  • Cay Horstmann Said:

    The Compose key is another really useful feature of Linux that does not seem to have an analog in Windows or Mac OS. (I map mine to CapsLock, which I DON'T REALLY NEED.) Compose + " + u gives an ü, as in übergeek. Really useful if you need to type something in français (that's Compose + , + c for the ç). Or if you want to use a ⇒ in your Scala programs. (For that, you need to edit the compose key mapping, to map = > to ⇒, but that's not a blocker for an übergeek.)

  • Deekshith Allamaneni Said:

    Thanks for the text shortcuts. esp ctrl and shift mouse clicks.

  • marc Said:

    Very incomplete indeed... You forgot Ctrl+Tab to navigate between Firefox open tabs. The uttermost useful Ctrl+Alt and left/right arrow to navigate between them virtual desktops... Shift+Insert to paste from Ctrl+C. The fabulous Shift+Alt to navigate in between tty console. And the salvating Ctrl+Alt+F1,2,3,4... to open a console.

  • marc Said:

    May I suggest also the double click to select a word and the triple click to select an entire paragraph...

  • flatcap Said:

    For Gnome 3 you can use the Super (Windows) key and Arrow keys to tile applications: Super-Left: Application fills the left-hand side of the screen Super-Right: Application fills the right-hand side of the screen Super-Up: Application fills the entire screen (maximise) Super-Down: Application returns to original size (un-maximise)

  • littlenoodles Said:

    The one keyboard shortcut feature from Windows that I miss in Linux (actually, it's practically the *only* Windows feature I miss) is the way 'application launching' shortcuts work. In Windows, an app launching keystroke launches the app the first time and thereafter, brings focus to the launched app. I use this constantly at work to switch between the various windows I use as a developer. When I need one of these windows, I hit the keystroke, and if I haven't launched it yet, it comes up. If I have, it comes to the front. On linux (my experience is with kde, but I imagine gnome has the same problem), the launch shortcut merely launches the app. Hit it again, and you get another instance. I think kde has a way to have a shortcut bring an app to the front, but that's a different shortcut than one that launches an app. I think there must be something about the way apps are started in linux (or the way windows and processes are associated) that makes it impossible for the window manager to do both functions with a single shortcut. But it makes app launching shortcuts much less useful.

  • Ken Said:

    I seem to remember this working for other MS versions Applies to all editions of Windows Vista. Create keyboard shortcuts to open programs You can create keyboard shortcuts to open programs, which can often be simpler than opening programs using your mouse or other pointing device. Before completing these steps, verify that a shortcut was created for the program to which you want to assign a keyboard shortcut. If no shortcut was created, browse to the folder that contains the program, right-click the program file, and then click Create Shortcut to create one. 1. Locate the shortcut to the program for which you want to create a keyboard shortcut. 2.Right-click the shortcut, and then click Properties. 3.In the Shortcut Properties dialog box, click the Shortcut tab, and then click the Shortcut key box. 4.Press the key on your keyboard that you want to use in combination with CTRL+ALT (keyboard shortcuts automatically start with CTRL+ALT), and then click OK. If you are prompted for an administrator password or confirmation, type the password or provide confirmation. You can now use this keyboard shortcut to open the program when you're using the desktop. The shortcut will also work while using some programs, though it might not work with some programs that have their own keyboard shortcuts. Notes• The Shortcut key box will display None until you select the key, and then the box will display Ctrl+Alt followed by the key you selected. • You cannot use the ESC, ENTER, TAB, SPACEBAR, PRINT SCREEN, SHIFT, or BACKSPACE keys to create a keyboard shortcut. Was this helpful?


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board