z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Path and path name

z/OS UNIX System Services User's Guide
SA23-2279-00

The set of names required to specify a particular file in a hierarchy of directories is called the path to the file, which you specify as a pathname. Path names are used as arguments for commands.

An absolute path name is a sequence that begins with a slash for the root, followed by one or more directory names separated with slashes, and ends with a directory name or a file name. The search for the file begins at the root and continues through the elements in the path name until it gets to the final name. For example:
/u/smitha/projectb/plans/1dft
is the absolute path name for 1dft, the first draft of the plans for a particular project that a user named Alice Smith (smitha) is working on.
Instead of using the absolute path name with shell commands, you can specify a path name as relative to the working directory; this is called the relative path name. In most cases, a user can specify a particular file without having to use its absolute path name. A relative path name does not have a / at the beginning, and the search for the file begins in the working directory. For example, if Alice Smith is working in the directory projectb, she can specify the relative path name for the file /u/smitha/projectb/plans/1dft as:
plans/1dft

A path name can be up to 1023 characters long, including all directory names, file names, and separating slashes. For path names and file names, use characters from the POSIX portable character set. Using DBCS data in these names is not recommended; it may cause unpredictable results.

The system performs path name resolution to resolve a path name to a particular file in a file hierarchy. The system searches from element to element in a path name in order to find the file.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014