skip to main |
skip to sidebar
In my previous post, there were some things I missed out, which I'll now fill you in on. First of all, if something has hung, it can be a pain to try and launch a terminal just to close something down, but you don't need to. Just press Alt+F2 in Ubuntu to get the Run dialog and enter xkill there.But what about if the entire screen has hung and it's too slow to do anything? Well, there's several options here. You can press Ctrl+Alt+Backspace to restart your X window server, but that's overkill. A better idea is to press Ctrl+Alt+F2 to take you to a virtual terminal. You can log in by entering your username, then you'll be prompted for your password. Once you've logged in, enter the following command:top
This displays a list of the running applications. It includes details of how much memory and CPU each is using. Look for the application you want to stop, and note the PID (process ID) number. Then press Q to exit top.Now you know this number, it's easy to kill the process from the command line. If this number was 1234 for the program you wanted to stop, you'd enter the following:kill 1234
Easy! Now press Ctrl+Alt+F7 and you'll be back at your desktop as usual, minus the hung application.
One of the great things about using Linux is that help is never far away. Every command has (or, at least, should have!) a manual included with it, known as the man page. As an example, if you enter the following:man man
to display the man page for man, you will get a description of how to use the man command. Have a quick read of it, just to familiarise yourself with a typical man page. You can navigate up and down using either the cursor keys or J for down and K for up (this is because the Vim text editor uses these keys to move up and down), or Page Up/Page Down. Once you're done, press Q to exit and return to the command line.By now, you should be able to use a few basic commands such as nano, apt-get, apt-cache and dpkg, so try looking at the man pages for these. You'll probably find that many of these commands can be used for a LOT more than you've used them for so far.
The syntax is always the same - man, then the command. For instance:man apt-get
to look at the man page for apt-get.Any time you don't know what a command does, try looking at its man page and that will give you some idea. Don't worry if it looks intimidating - it is at first, but with time you'll get used to them. Remember, they're not something you have to commit to memory, but a reference. They're there if you need help with something, but many of the things in them you may only use once in a blue moon (if at all).