basename(3G) basename(3G)
basename - return the last element of a pathname
cc [flag <b>...] file ... -lgen [library <b>...]
#include <libgen.h>
char *basename (char *path);
Given a pointer to a null-terminated character string that contains a
pathname, basename returns a pointer to the last element of path.
Trailing ``/'' characters are deleted.
If path or *path is zero, pointer to a static constant ``.'' is returned.
Input string Output pointer
_____________________________
/usr/lib lib
/usr/ usr
/ /
basename(1), dirname(3G)
PPPPaaaaggggeeee 1111 [ Back ]
|