BASENAME(1)

πŸ“¦ version 0.12.0, in arch rolling

πŸ’… BASENAME(1) β€” okay so this is basename, bestie

So like, the manual name is basename and it lives in the General Commands Manual section 1, and honestly? It's giving "small but mighty." Let's get into it. πŸŽ€


✨ NAME ✨

basename β€” print NAME with any leading directory components removed. If specified, also remove a trailing SUFFIX. 🫢 That's it. That's the whole job. And it ate.


🌸 SYNOPSIS 🌸

basename [-z] NAME [SUFFIX]
basename OPTION... NAME...

Two whole modes, no cap. Either you hand it a NAME (and optionally a SUFFIX), or you go full options mode and give it OPTION... plus NAME.... Pick your fighter. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Print NAME with any leading directory components removed. If specified, also remove a trailing SUFFIX.

Lowkey the most straightforward icon in the whole toolchain β€” you give it a path, it gives you the last bit of that path, and if you tell it about a SUFFIX it'll strip that off the end too. Periodt. ✨


πŸ’œ OPTIONS πŸ’œ

  • -a, --multiple β€” support multiple arguments and treat each as a NAME πŸŽ€ (more than one bestie at a time, we love to see it)
  • -s, --suffix <SUFFIX> β€” remove a trailing SUFFIX; implies -a ⭐ (yes bestie, it sneaks in -a all on its own, that's just the vibe)
  • -z, --zero β€” end each output line with NUL, not newline 🌈 (for when you're piping into something that wants NUL-separated output β€” very much iykyk)
  • -h, --help β€” print help πŸ™ˆ (the classic "wait what does this do again" button)
  • -V, --version β€” print version πŸ‘‘ (for when you gotta know exactly which build you're running)

πŸ”₯ VERSION πŸ”₯

v(uutils coreutils) 0.12.0


fr fr, no surprises here β€” no environment variables, no exit status section, no files, no warnings. Just a clean little utility doing exactly what it says on the tin. πŸ’–

Okay that's the whole page, bestie β€” hope it slayed for you πŸ§šπŸ’œ

✧ο½₯゚ uutils coreutils 0.12.0 Β· dated 2026-09-17 Β· BASENAME(1) Β· catch you in the group chat ✧ο½₯゚

πŸ“¦ where this page comes from