About Us Documentation

Contact Site Map



Go to the previous, next chapter.

File name manipulation

This section describes commands that manipulate file names.

basename: Strip directory and suffix from a file name


basename name [ suffix ]

The basename command removes any leading directory components from name. If suffix is specified and is identical to the end of name, it is removed from name as well. basename prints the result on standard output.

The only options are --help and --version. See section Common options.

dirname: Strip non-directory suffix from a file name


dirname name

dirname prints all but the final slash-delimited component of name. If name is a single component, dirname prints . (meaning the current directory).

The only options are --help and --version. See section Common options.

pathchk: Check file name portability


pathchk [ option ]... name...

For each name, pathchk prints a message if any of these conditions is true:

  1. - one of the existing directories in name does not have search (execute) permission,
  2. - the length of name is larger than its filesystem's maximum file name length,
  3. - the length of one component of name, corresponding to an existing directory name, is larger than its filesystem's maximum length for a file name component.

The program accepts the following option. Also see section Common options.

-p - --portability - -p - --portability - Instead of performing length checks on the underlying filesystem, test the length of each file name and its components against the POSIX.1 minimum limits for portability. Also check that the file name contains no characters not in the portable file name character set.

Exit status:

0 if all specified file names passed all of the tests,
1 otherwise.



Email addresses listed on this site may  NOT be used for unsolicited commercial email.

Ready-to-Run Software, Inc Privacy Statement

Portions (c)Copyright, 1996-2005 by Ready-to-Run Software, Inc
(All rights reserved.)
212 Cedar Cove
Lansing, NY 14882
Phone: 607 533 UNIX (8649)
Fax: 607 533 4002