code: 9ferno

ref: 600bbfe4aaa9ad0f73d8d73eef1b7670e5f7d3a3
dir: /man/1/basename/

View raw version
.TH BASENAME 1 
.SH NAME
basename \- strip file name affixes
.SH SYNOPSIS
.B basename
[
.B -d
]
.I string
[
.I suffix
]
.SH DESCRIPTION
.I Basename
deletes any prefix ending in slash
.RB ( / )
and the
.IR suffix ,
if present in
.IR string ,
from
.IR string ,
and prints the result on the standard output.
.PP
The
.B -d
option instead prints the directory component,
that is,
.I string
up to but not including the final slash.
If the string contains no slash,
the current directory name
.L .
is printed.
.SH SOURCE
.B /appl/cmd/basename.b
.SH SEE ALSO
.IR cleanname (1),
.IR pwd (1),
.IR names (2)