basename, dirname - strip off file prefixes and suffixes
basename file [suffix]
# Strips path to yield file.c
basename /user/file.c .c
# Strips path and .c to yield file
# Strips basename to yield /user
Basename removes the initial directory names (if any) yielding the name
of the file itself. If a second argument is present, it is interpreted
as a suffix and is also stripped, if present.
Dirname removes the final component of a path, yielding the directory a
file is in.
These programs are primarily used in shell scripts.