Quantcast
Viewing all articles
Browse latest Browse all 14

Linux command line basics for beginners: Part 3

Here's another installment of the Linux CLI basics series. This time we will deal with other interest-worthy tasks, like setting up your keyboard layout or using utilities to find files on your drive(s). We hope that the series will help you become a keyboard/terminal guru.

The tasks, part three

Setting the keyboard layout

When you're using some fancy desktop environment, changing the layout of your keyboard is simple and easy. A few clicks, you choose your preferred layout and maybe other localization settings and that's that. But what if you find yourself at a command-line-only machine and you have to use the machine, but the layout is set to French? The keys show a symbol but you type another and nothing works as it should. What to do? Or you decided to dump bloated GNOME or KDE for some lightweight window manager like Fluxbox. What you should use for this task strictly depends on whether you have X installed or not. If you do, the utility is called setxkbmap. If you don't you can use various tools provided by your distro (by the way, remember that we are using Ubuntu for our examples), but we will show you how to do it in terminal-only mode without depending on some distro-specific tools.

The first method shown will be the one that assumes that you have X.org installed and you're using it in conjunction with some WM, but you don't have any specific GUI tools for layout changes. As always, I recommend you take a few minutes to look over the setxkbmap manual page to get an idea of the options and general usage flags. As you can imply, the utility's name stands for "set X keyboard map". I remember using shell scripts that contained only the setxkbmap lines needed and then setting up keyboard shortcuts that invoked said scripts as needed (~/.fluxbox/keys): maybe this is a trick you will use after reading this article so that your work will become easier. That's the charm of Linux, there are virtually no limits on what you can do with it.

Enough talk, let's see some practical examples. If I have the US English layout set as default, which happens in most cases, and I want to change it to French, all I have to do is


Viewing all articles
Browse latest Browse all 14

Trending Articles