As you begin using UNIX and start moving around in directories and files, you're likely to get a bit lost—that is, forget which directory or subdirectory you're in. You can use the pwd command to get a reminder of where you are, as shown in Code Listing 1.5.
You can request just the directory name, or you can get fancy and request the directory's name and its contents, courtesy of ls.
To find out the name of the current directory:
pwd
To find out the name of the current directory and its contents:
ls ; pwd
Tip
Type in pwd immediately after you log in. You'll see where your home directory is in the overall system (aka the full path name for your home directory).
Tip
On some UNIX systems, you won't need to use pwd to find out where you are. Some systems display the current directory at the shell prompt by default—something like /home/ejr>. If you'd like to add or get rid of this, or if you want more information about shells and customizing your shell, see Chapter 8, Configuring your UNIX environment.
xmission> pwd /home/users/e/ejray xmission> ls ; pwd Mail/ Project/ chat.conf/ ftp@ temp/ NewProject/ access/ dead.letter mail/ News/ ch1info.txt files public_html/ /home/users/e/ejray xmission> |
18.219.220.22