Introduction

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 terminal and environment.

basename

Take a full path and strip out all but the last element.

dirname

Take a full path and display all but the last element.

namei

Follow a path to the end, if it has one.

pathchk

Check paths for portability and validity.

 



Linux Desk Reference
Linux Desk Reference (2nd Edition)
ISBN: 0130619892
EAN: 2147483647
Year: 2000
Pages: 174
Authors: Scott Hawkins

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net