pwd(n)

pwdn

Return the absolute path of the current working directory

Usage

pwd

Overview

Returns the absolute path name of the current working directory.

Examples

Sometimes it is useful to change to a known directory when running some external command using exec, but it is important to keep the application usually running in the directory that it was started in (unless the user specifies otherwise) since that minimizes user confusion. The way to do this is to save the current directory while the external command is being run: set tarFile [file normalize somefile.tar] set savedDir [pwd] cd /tmp exec tar -xf $tarFile cd $savedDir

Keywords

working directory

Releases

163 releases since Mac OS X 10.0; the text changed 5 times.

  1. 10.0–10.1.5
  2. 10.2–10.2.8
  3. 10.3–10.3.9
  4. 10.4–10.4.2
  5. 10.4.3–10.5.8
  6. 10.6–26.5

From tcl 152 in macOS 26.5. Parsed by carta from the page's man source.