Node:Current directory, Next:, Previous:Job control, Up:System interface



Current directory

pwd Function
Returns the current working directory (as a string).

cd dir Macro
Charges the current working directory to dir (which is quoted).

If dir is relative (does not begin with a /), and the CDPATH environment variable is defined, then cd will search each of the directories in CDPATH for a sub-directory dir. Here, CDPATH is a string of directory names, separted by colons; it should begin with ..

cd will try to hide symbolic links: If you cd down a symbolic link, and later cd .., you will get back where you started. In contrast, the chdir routine will follow the physical .. link in the file system.

If dir is -, it is replaced by the value of $OLDPWD. Thus cd - is the same as cd $OLDPWD.

cd Macro
Change the current working directory to the user's home directory.

chdir dir Function
Charges the current working directory to dir (which is evaluated). If dir is "", same as chdir env'HOME. The chdir routine is a low-level routine that ignores CDPATH, and does not so anything special for symbolic links.

PWD Variable
Current working directory as set by cd or chdir.

OLDPWD Variable
Previous working directory as set by cd or chdir.