BASENAME(1plan9)
β¨ NAME β¨
okay bestie, meet basename β sheβs from the 1plan9 manual, section 1, and her whole entire job is strip file name affixes. thatβs it. thatβs the gig. no cap. π
πΈ SYNOPSIS πΈ
basename [ -d ] string [ suffix ]
π¦ DESCRIPTION π¦
Basename deletes any prefix ending in slash (/) and the suffix, if present in string, from string, and prints the result on the standard output. main character behavior, honestly. chop the path bits, keep it moving. β¨
-dβ instead prints the directory component, that is,stringup to but not including the final slash. If thestringcontains no slash, a period and newline are printed.
lowkey important: when thereβs no slash for -d to find, you get a period and a newline. thatβs the whole output. periodt. π
π₯ SOURCE π₯
/src/cmd/basename.c
and thatβs the page, bestie β filed under the 1plan9 manual, section 1, with the source chilling at /src/cmd/basename.c. no date drama on this one, just iconic timeless Unix utility energy. mwah π
π¦ where this page comes from
- debian bookworm: 9base 1:6-13 Β· Lucent
- debian trixie: 9base 1:6-14 Β· Lucent
- ubuntu jammy: 9base 1:6-11 Β· Lucent
- ubuntu noble: 9base 1:6-14 Β· Lucent
- ubuntu questing: 9base 1:6-15
- ubuntu resolute: 9base 1:6-15build1 Β· Lucent
- ubuntu stonking: 9base 1:6-15build1 Β· Lucent
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms