Chapter 3. You Are Here

Table of Contents
Finding Yourself with pwd
Getting from Here to There: cd
Looking Around with ls
A Larger Picture of the Filesystem
"Washing" the Window
Using cat
Using Redirection
Appending Standard Output
Redirecting Standard Input
Pipes
Stringing Commands Together
Ownership and Permissions
Fun with Numbers in chmod

Let's say you want to buy a pair of sneakers at a nearby shopping mall. You may not be familiar with the mall, but that shouldn't be a problem.

Why not? Because of the maps, which you can usually find near all the major entrances to the mall.

The same can be said for your Red Hat Linux system: Navigation's easy once you know where you're going.

Tip: Make sure you've logged into your user account! Remember that unless you like to live on the wild - and dangerous - side, using a root account for all your activities is toying with disaster. If you didn't create your user account at the time of your Red Hat Linux installation and haven't done so now, please do so now. Turn to Chapter 2 if you require assistance on how to create your user account.

Finding Yourself with pwd

Sooner or later (probably sooner), when you start looking through directories, you're bound to ask, "Where the heck am I?" And you won't be speaking philosophically.

DOS can answer that question just by showing you at the prompt like:

C:\GAMES\Game\ID1>
	  

But Bash, the shell for your Linux system shows, by default, just shows your current directory.

Figure 3-1. The Command pwd Shows You Where You Are

Try this: open an Xterm window. You'll see something like:

[billy@localhost billy]$
	  

Now type:

pwd
	  

What do you see? Something like

/home/billy
	  

The command pwd stands for print working directory. When you typed pwd, you were asking your Linux system, "where am I?" Your system responded by "printing" the directory you're in to the monitor -- also known as the standard output.

Seems easy, right? It ought to be; you'll be using pwd plenty as you look around. (Even Linux gurus can depend on this little command.)