Ubuntu Pocket Guide and Reference

Page 89

As you might be realizing, a virtual console session is a little clunky. A more convenient way to access the command-line is to use a terminal program. This provides a command-line right there on the desktop. Logout of the virtual console by typing exit, and switch back to your desktop (hit Ctrl+Alt+F7). Then open a terminal window by clicking Applications Accessories Terminal.

This time there’s no need to login, because the terminal window runs as part of your desktop environment, and that’s already logged-in.

NOTE So why use a virtual console? Well, they’re very useful when things go wrong. If the GUI crashes, you can switch to a virtual console to try and fix things. Even if there’s no GUI subsystem, the virtual console will still be there. It’s a permanent fixture of Linux.

Knowing who you are

When the terminal program appears, you’ll see something like this: keir@keir-desktop:~$

This is the actual command-line prompt, often shorted to “prompt”.

The first part of the prompt shows your username. In this example, taken from my test PC, the user is keir. After the @ sign is the name of the computer, commonly referred to as the hostname. This was set during installation of Ubuntu, on the same configuration screen where you chose your username.

The hostname is how the computer is known on the network. It isn’t very important if your computer only connects to the Internet via a router or modem, but it’s vital if Ubuntu is used in a server environment, or if you intend to remotely access it across the Internet.

As you can see, the computer in my test PC setup is called keirdesktop and so, reading the full prompt, we can see that the user named keir is logged in at (@) the computer named keir-desktop. In other words, the first part of the prompt is all about who you are and where you’re logged in.

Knowing where you’re browsing

After this is a colon. This separates the physical location part of the prompt from the rest, that tells us the location in the filesystem—which folder we’re currently browsing. We see a ~ symbol (known as a tilde). This is shorthand that always indicates the user’s /home folder. When you see a tilde, imagine the path to your home folder instead.

Hands-on at the Command-Line : 69


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.