In computing, the working directory is the directory of a file system to which a relative path is relative.
In a command-line environment, a user often uses files in or relative to the working directory. The system state that identifies the working directory provides a convenient way to define the context of work. Users can use paths that are conceptually simpler and usually shorter, instead of always using absolute paths. For example, for working directory <kbd>/home/user/data</kbd> on a Unix-like system, the file name <kbd>foo.txt</kbd> (a relative path) refers to absolute path <kbd>/home/user/data/foo.txt</kbd>. System state for working directory often also applies in a graphical user interface (GUI), but often is not useful since the GUI environment maintains directory context in a different way.
As a feature, working directories vary by environment yet have some common, typical attributes. Typically, each process has a separate working directory, which allows users to have a different working directory for each shell running on the operating system. Although common in systems that provide a hierarchical file system, the working directory feature is not required; for example, the DX10 operating system does not provide it, as all pathnames are either absolute or relative to the system volume.
Alternate names include current working directory (CWD)
References
</references>
Further reading
External links
- Working Directory (wd) at Github a software package that tracks commonly used directories in a bash session
