Linux Commands: An Easy Start


When you talk about commands, it invariably means working at the shell level: the command prompt. That's the dollar sign prompt ($), and it is common to many command shells. Some of the commands I will give you require administrative privileges. When this is necessary, I'll have you type sudo before the command, at which point you will be asked for your password. It is possible to maintain administrative privileges over the course of several commands by typing sudo -i. When you are running in admin mode, you will see a different prompt (#), which goes by many names. In North America, we call it the pound sign or the hash mark. My English lit friends tell me it's an octothorpe. Others call it the tic-tac-toe board.

To exit admin mode, you just type exit. However, in my examples, I'll prepend all admin commands with sudo. Whether you choose to enter an extended admin session is something I leave up to you. That said, for most of this chapter, a non-admin, dollar-sign prompt ($) is the way to go. Never run as the administrator unless you need to.

Getting to the Shell

If you are running from a graphical environment, as you likely are, start a Terminal session by clicking Applications on the top panel, and selecting Terminal from the Accessories submenu. The GNOME terminal program supports tabbed shells so you can run multiple shell sessions from one terminal window (see Figure 21-1). Just click File on the menu bar and select Open Tab. You can then click back and forth from one shell to the other. You can even cut and paste between sessions. This is very handy if you are working on multiple systems.

Figure 21-1. Running commands from a bash shell inside the GNOME terminal.


As you work your way through this chapter, you'll notice that I toss in little boxes like the one that follows. If these commands are not already in your arsenal, spend a few minutes playing with them and finding out what they do.

Commands to Know and Love, Part 1

date

Date and time.

df -H

Show me how much free space my disks have, in a nice, human-readable format.

who

Who is logged on to the system?

w

Similar to who but with different information.

cal

Show me a calendar.

tty

Identify your workstation.

echo

Hello, ello, llo, lo, o, o, o. . . . Try typing echo "Hello world."

last

Who last logged in and are they still logged in?





Moving to Ubuntu Linux
Moving to Ubuntu Linux
ISBN: 032142722X
EAN: 2147483647
Year: 2004
Pages: 201

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net