logo

utils-std

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

ln.1 (1602B)


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