lk/basics/links.md

20 lines
390 B
Markdown
Raw Permalink Normal View History

2022-01-16 18:20:39 +00:00
---
title: "links"
2022-01-26 21:29:48 +00:00
tags: [ "Documentation", "Basics" ]
2022-01-16 18:20:39 +00:00
---
2020-01-02 00:04:35 +00:00
Link from X to Y.
```bash
ln -s X ../otherdir/Y
```
2020-01-02 00:04:35 +00:00
2022-01-26 21:29:48 +00:00
If you want a hard link, this will make a single file exist in two locations.
If it is deleted in one location, it continues to exist in the other.
2020-01-02 00:04:35 +00:00
```bash
ln *X* *Y*
```
2022-01-26 21:29:48 +00:00
Both files must be on the same hard drive, as they have the same inode (check this with `ls -i file`).
2020-01-02 00:04:35 +00:00