3 basename, dirname \- strip off file prefixes and suffixes
5 \fBbasename \fIfile\fR [\fIsuffix\fR]\fR
20 .B basename /user/ast/file.c
21 # Strips path to yield \fIfile.c\fP
23 .B basename /user/file.c .c
24 # Strips path and \fI.c\fP to yield \fIfile\fP
26 .B dirname /user/file.c
27 # Strips basename to yield \fI/user\fP
31 removes the initial directory names (if any) yielding the name of the
33 If a second argument is present, it is interpreted as a suffix and is
34 also stripped, if present.
37 removes the final component of a path, yielding the directory a file is in.
39 These programs are primarily used in shell scripts.