Introduction

The path to a file is an ordered specification of the subdirectories through which one must pass in order to find that file. Linux paths are delimited (separated) by the forward slash character, “/”. A path that begins with a forward slash is assumed to start at the root directory and is called an absolute path. A path that does not begin with the forward slash character is called a relative path and is assumed to refer to files relative to the current working directory.

Occasionally when you're writing a script or program, it's handy to get access to the text string that is all or part of a path. The commands in this section help you do that. If you're looking for information on the environment variable PATH, check the chapter on ...

Get Linux® Desk Reference, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.