logo

utils-std

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

ln.1 (1806B)


  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 January 22, 2025
  5. .Dt LN 1
  6. .Os
  7. .Sh NAME
  8. .Nm ln
  9. .Nd create hard links and symbolic links
  10. .Sh SYNOPSIS
  11. .Nm
  12. .Op Fl fnv
  13. .Op Fl L Ns | Ns Fl P
  14. .Fl T
  15. .Ar source
  16. .Ar target
  17. .Nm
  18. .Op Fl fnv
  19. .Op Fl L Ns | Ns Fl P
  20. .Ar source...
  21. .Op Ar target
  22. .Nm
  23. .Op Fl fnv
  24. .Fl Ts
  25. .Ar reference
  26. .Ar target
  27. .Nm
  28. .Op Fl fnv
  29. .Fl s
  30. .Ar reference...
  31. .Op Ar target
  32. .Sh DESCRIPTION
  33. .Nm
  34. create links at
  35. .Ar target
  36. for each given
  37. .Ar source
  38. or
  39. .Ar reference .
  40. .Pp
  41. Unless
  42. .Fl T
  43. is passed, when
  44. .Ar target
  45. is an existing directory or multiple
  46. .Ar source
  47. or
  48. .Ar reference
  49. are given,
  50. .Nm
  51. will create links into
  52. .Ar target .
  53. If
  54. .Ar target
  55. is unspecified, then it is set to the current directory, as if
  56. .Qq \&.
  57. would have been passed.
  58. .Pp
  59. Should be noted that unlike commands like
  60. .Xr cp 1 ,
  61. .Ar reference
  62. is kept as is and therefore is always relative to
  63. .Ar target
  64. rather than the current directory.
  65. .Sh OPTIONS
  66. .Bl -tag -width __
  67. .It Fl f
  68. Forcefully create links by removing existing entries.
  69. .It Fl L
  70. If
  71. .Ar source
  72. is a symbolic link, dereference it.
  73. .It Fl n
  74. Prevent descending into
  75. .Ar target
  76. as a directory if it is a symbolic link.
  77. .It Fl P
  78. If
  79. .Ar source
  80. is a symbolic link, hard link it.
  81. This is the default.
  82. .It Fl s
  83. Create symbolic links instead of hard links.
  84. .It Fl T
  85. Always treat
  86. .Ar target
  87. as a normal file.
  88. .It Fl v
  89. Print successfully created links.
  90. .El
  91. .Sh EXIT STATUS
  92. .Ex -std
  93. .Sh STANDARDS
  94. .Nm
  95. should be compliant with the
  96. IEEE Std 1003.1-2024 (“POSIX.1”)
  97. specification.
  98. The
  99. .Fl n ,
  100. .Fl T ,
  101. and
  102. .Fl v
  103. options are extensions.
  104. Support for unspecified
  105. .Ar target
  106. is an extension.
  107. .Sh AUTHORS
  108. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me