logo

utils-std

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

ln.1 (1435B)


  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. .Ar target
  16. .Nm
  17. .Fl s
  18. .Op Fl fn
  19. .Ar reference...
  20. .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. .Pp
  41. Should be noted that unlike commands like
  42. .Xr cp 1 ,
  43. .Ar reference
  44. is kept as is and therefore is always relative to
  45. .Ar target
  46. rather than the current directory.
  47. .Sh OPTIONS
  48. .Bl -tag -width __
  49. .It Fl f
  50. Forcefully create links by removing existing entries.
  51. .It Fl L
  52. If
  53. .Ar source
  54. is a symbolic link, dereference it.
  55. .It Fl n
  56. Prevent descending into
  57. .Ar target
  58. as a directory if it is a symbolic link.
  59. .It Fl P
  60. If
  61. .Ar source
  62. is a symbolic link, hard link it.
  63. This is the default.
  64. .It Fl s
  65. Create symbolic links instead of hard links.
  66. .It Fl v
  67. Print successfully created links.
  68. .El
  69. .Sh EXIT STATUS
  70. .Ex -std
  71. .Sh STANDARDS
  72. .Nm
  73. should be compliant with the
  74. IEEE Std 1003.1-2024 (“POSIX.1”)
  75. specification.
  76. The
  77. .Fl n
  78. and
  79. .Fl v
  80. options are extensions.
  81. .Sh AUTHORS
  82. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me