logo

utils-std

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

ln.1 (1381B)


  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 fn
  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. .El
  67. .Sh EXIT STATUS
  68. .Ex -std
  69. .Sh STANDARDS
  70. .Nm
  71. should be compliant with the
  72. IEEE Std 1003.1-2024 (“POSIX.1”)
  73. specification.
  74. The
  75. .Fl n
  76. option is an extension.
  77. .Sh AUTHORS
  78. .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me