BASENAME(1) BSD BASENAME(1)
NAME
basename - strip filename affixes
SYNOPSIS
basename string [ suffix ]
DESCRIPTION
basename deletes from string any prefix ending in a slash (/) and the
suffix, if present in string. It then prints the result on the standard
output. You normally use the basename command inside substitution marks
(` `) in shell procedures.
EXAMPLE
This shell procedure, invoked with the argument /usr/src/bin/cat.c
compiles the named file and moves the output to cat in the current
directory:
cc $1
mv a.out `basename $1 .c`
SEE ALSO
csh(1), sh(1)