2014-02-17 11:59:07 -05:00
|
|
|
# ln
|
|
|
|
|
2024-04-18 06:04:00 +02:00
|
|
|
> Create links to files and directories.
|
2025-01-18 18:45:33 +05:30
|
|
|
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/ln-invocation.html>.
|
2014-02-17 11:59:07 -05:00
|
|
|
|
2019-02-08 01:31:19 +01:00
|
|
|
- Create a symbolic link to a file or directory:
|
2014-02-17 11:59:07 -05:00
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
`ln {{[-s|--symbolic]}} {{/path/to/file_or_directory}} {{path/to/symlink}}`
|
2014-02-17 11:59:07 -05:00
|
|
|
|
2020-10-29 02:28:52 +13:00
|
|
|
- Overwrite an existing symbolic link to point to a different file:
|
2015-03-15 11:40:20 +00:00
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
`ln {{[-sf|--symbolic --force]}} {{/path/to/new_file}} {{path/to/symlink}}`
|
2015-03-15 11:40:20 +00:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Create a hard link to a file:
|
2014-02-17 11:59:07 -05:00
|
|
|
|
2021-06-02 21:55:26 +00:00
|
|
|
`ln {{/path/to/file}} {{path/to/hardlink}}`
|