Blob
1 .TH BASENAME 12 .SH NAME3 basename \- strip file name affixes4 .SH SYNOPSIS5 .B basename6 [7 .B -d8 ]9 .I string10 [11 .I suffix12 ]13 .SH DESCRIPTION14 .PP15 .I Basename16 deletes any prefix ending in slash17 .RB ( / )18 and the19 .IR suffix ,20 if present in21 .IR string ,22 from23 .IR string ,24 and prints the result on the standard output.25 .PP26 The27 .B -d28 option instead prints the directory component,29 that is,30 .I string31 up to but not including the final slash.32 If the string contains no slash,33 a period and newline are printed.34 .SH SOURCE35 .B \*9/src/cmd/basename.c