BASENAME(1)
NAME
basename − strip filename affixes
USAGE
basename string [ suffix ]
DESCRIPTION
Basename deletes any prefix ending in a slash (/) and the suffix, if present in string, from string. It then prints the result on the standard output. Basename is normally used inside substitution marks (` `) in Shell procedures.
EXAMPLE
This Shell procedure, invoked with the /usr/src/bin/cat.c argument, compiles the named file and moves the output to cat (1) in the current directory:
cc $1
mv a.out `basename $1 .c`