Previous | Table of Contents | Next |
DESCRIPTION
The pwd command displays the full path of your present working directory. The present working directory is often referred to as the current working directory or current directory . Since the command that returns the present working directory is pwd, we will refer to it as such. The csh uses the cwd variable to store the name of the current working directory. But it uses the pwd command to display the contents of the variable.
COMMAND FORMAT
The format of the pwd command follows .
pwd
FURTHER DISCUSSION
The UNIX System has file systems that are hierarchical tree structures containing directories and files. The system administrator created a directory somewhere in this hierarchy. When you log in you are positioned at this directory, known as your login or HOME directory. Since this is your home directory, you own it and all the files under it. Therefore, you have full permissions to read, write, create, change, or delete the contents of your home directory.
The pwd command is an alias command and an external command. The alias for pwd is print - $PWD . The external command is located in /bin/pwd. Both of these commands perform the same function. The main difference is the internal pwd command executes much faster than the /bin/pwd command.
RELATED COMMANDS
Refer to the cd command described in Module 14.
RELATED FILES
The pwd command sends its output to the standard output.
APPLICATIONS
The pwd command is used to display where you are currently located in the file system hierarchy. It is used as a check for the cd command. You may not remember which directory you are in, and pwd will tell you. Once you cd to a new directory you use pwd to show the new path.
TYPICAL OPERATION
In this activity you use the pwd command to display your HOME directory and then, using cd to move, you display your parent directory. Begin at the shell prompt.
cj> pwd /u1/ts/mylogin
cj> pwd /u1/ts
Previous | Table of Contents | Next |