Skip to content

basename


NAME
     basename - strip directories from a path

SYNOPSIS
     basename string [suffix]

DESCRIPTION
     Print the last part of a path, with an optional suffix removed as
     well. Used inside shell scripts to turn a file name into the name of
     the thing it builds.

EXAMPLES
     basename /usr/src/cmd/hello.c .c        hello

SEE ALSO
     sh(1), make(1)