# symbolic vs hard link

from <http://stackoverflow.com/a/185903/546750>

> Underneath the file system files are represented by inodes (or is it multiple inodes not sure)
>
> A file in the file system is basically a link to an inode. A hard link then just creates another file with a link to the same underlying inode.
>
> When you delete a file it removes one link to the underlying inode. The inode is only deleted (or deletable/over-writable) when all links to the inode have been deleted.
>
> A symbolic link is a link to another name in the file system.
>
> Once a hard link has been made the link is to the inode. deleting renaming or moving the original file will not affect the hard link as it links to the underlying inode. Any changes to the data on the inode is reflected in all files that refer to that inode.
>
> Note: Hard links are only valid within the same File System. Symbolic links can span file systems as they are simply the name of another file.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://til.yulrizka.com/linux/symbolic-vs-hard-link.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
