basename, dirname — Deliver Portions of Path Names

Synopsis

/usr/bin/basename string [suffix] 
/usr/xpg4/bin/basename string [suffix] dirname string
					

Description

You can use the basename command to strip path names off a file name. For example, if you have an environment variable that contains a complete path name, you might want to extract just the name of the file without the complete path. This command is normally used inside substitution marks (``) within shell procedures.

/usr/bin/basename

The suffix is a pattern defined on the expr(1) manual page.

/usr/xpg4/bin/basename

/usr/xpg4/bin/basename is a POSIX-compliant version of the /usr/bin/basename command. See standards(5).

The suffix is a string with no special significance attached ...

Get Solaris™ 7 Reference 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.