logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git

basename.1 (772B)


  1. .\" utils-std: Collection of commonly available Unix tools
  2. .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. .\" SPDX-License-Identifier: MPL-2.0
  4. .Dd 2024-07-28
  5. .Dt BASENAME 1
  6. .Os
  7. .Sh NAME
  8. .Nm basename
  9. .Nd print last path component of a path
  10. .Sh SYNOPSIS
  11. .Nm
  12. .Op Ar path
  13. .Op Ar suffix
  14. .Sh DESCRIPTION
  15. .Nm
  16. prints the last path component of
  17. .Ar path
  18. with removing any trailing slashes as well as trailing
  19. .Ar suffix
  20. when applicable.
  21. .Pp
  22. When
  23. .Ar path
  24. isn't given or is an empty string
  25. .Dq \&.
  26. is printed.
  27. .Sh EXIT STATUS
  28. .Ex -std
  29. .Sh SEE ALSO
  30. .Xr dirname 1 ,
  31. .Xr basename 3
  32. .Sh STANDARDS
  33. .Nm
  34. should be compliant with the
  35. IEEE Std 1003.1-2024 (“POSIX.1”)
  36. specification.
  37. .Sh AUTHORS
  38. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me