Installation guide

102 Chapter 11. Shell Prompt Basics
The result was the Bourne Again Shell, or bash. Although your system came with several different
shells, bash is the default shell for Red Hat Linux. You can learn more about bash by reading the
bash man page (type man bash at a shell prompt).
11.3. Determining Your Current Directory with pwd
Once you start looking through directories, it is easy to get lost or forget the name of your current
directory. bash shows, by default, just your current directory, not the entire path.
Figure 11-2. The Command pwd Shows You Where You Are
To determine the exact location of your current directory within the file system, go to a shell prompt
and type the command pwd.
You should see something like:
/home/sam
This tells you that you are in the user sams directory, which is in the /home directory.
The command pwd stands for print working directory. When you typed pwd, you asked your Linux
system to display your current location. Your system responded by printing the name of the current
directory in the terminal window, also known as the standard output.
You will find that using pwd is very helpful as you learn to navigate your new Linux system.
11.4. Changing Directories with cd
Changing directories is easy as long as you know where you are (your current directory) and how that
relates to where you want to go.
To change directories, use the cd command. This command by itself will always return you to your
home directory; moving to any other directory requires a pathname.
You can use absolute or relative pathnames. Absolute paths start at the top with / (referred to as root)
and then look down for the requested directory; relative paths look down from your current directory,
wherever that may be. The tree below is used only as an example for the purpose of explaining cd.
/
directory1
directory2
directory3