logo

utils-std

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

readlink.1 (1469B)


  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-04-24
  5. .Dt READLINK 1
  6. .Os
  7. .Sh NAME
  8. .Nm readlink
  9. .Nd print content of a symbolic link
  10. .Sh SYNOPSIS
  11. .Nm
  12. .Op Fl f Ns | Ns Fl e
  13. .Op Fl n Ns | Ns Fl z
  14. .Ar path
  15. .Sh DESCRIPTION
  16. Note: For canonicalization of a path, use the
  17. .Xr realpath 1
  18. utility instead for better portability.
  19. .Pp
  20. The
  21. .Nm
  22. utility reads the symbolic link of each
  23. .Ar path
  24. and prints it.
  25. .Pp
  26. If
  27. .Ar path
  28. is not a symbolic link,
  29. .Nm
  30. errors out.
  31. .Sh OPTIONS
  32. .Bl -tag -width _n
  33. .It Fl f
  34. Canonicalize
  35. .Ar path
  36. with following every symlink, all but the last path component are required to exists.
  37. .It Fl e
  38. Canonicalize
  39. .Ar path
  40. with following every symlink, all path component must exists.
  41. .It Fl n
  42. Do not print a trailing separator.
  43. .It Fl z
  44. Use NULL byte as separator instead of newlines.
  45. .El
  46. .Sh EXIT STATUS
  47. .Ex -std
  48. .Sh EXAMPLES
  49. Assign
  50. .Pa //example.org/
  51. to
  52. .Pa foobar
  53. and read it:
  54. .Bd -literal
  55. $ ln -s //example.org/ foobar
  56. $ readlink foobar
  57. //example.org/
  58. .Ed
  59. .Sh SEE ALSO
  60. .Xr ln 1 ,
  61. .Xr readlink 3
  62. .Sh STANDARDS
  63. .Nm
  64. should be compliant with the
  65. IEEE Std 1003.1-2024 (“POSIX.1”)
  66. specification.
  67. .Pp
  68. The options
  69. .Fl f ,
  70. .Fl e
  71. and
  72. .Fl z
  73. and support for multiple
  74. .Ar path
  75. arguments are extensions present for compatibility with existing software.
  76. .Sh AUTHORS
  77. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me