Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
home_server:home_server_setup:other_services:symlinks [2024-12-01 Sun wk48 09:54] – [Simlinks] baumkp | home_server:home_server_setup:other_services:symlinks [2025-01-10 Fri wk02 11:55] (current) – [References] baumkp | ||
---|---|---|---|
Line 2: | Line 2: | ||
=====Simlinks===== | =====Simlinks===== | ||
- | A symlink is a soft or hard link to a directory location to another directory location or file. I am only interested in the soft link. It effectivily | + | A symlink is a soft or hard link to a directory location to another directory location or file. It effectively |
- | Simple use is: '' | + | Simple use is: |
+ | *'' | ||
+ | *'' | ||
+ | Where: | ||
*To remove symlink '' | *To remove symlink '' | ||
*To list symlink '' | *To list symlink '' | ||
*To list symlink directory contents '' | *To list symlink directory contents '' | ||
*Use '' | *Use '' | ||
+ | *Use '' | ||
*Use '' | *Use '' | ||
Line 14: | Line 18: | ||
^Comparison Parameters ^Hard link ^Soft link ^ | ^Comparison Parameters ^Hard link ^Soft link ^ | ||
|Inode number* |Files that are hard linked take the same inode number |Files that are soft linked take a different inode number | | |Inode number* |Files that are hard linked take the same inode number |Files that are soft linked take a different inode number | | ||
- | |Directories |Hard links are not allowed for directories | + | |Directories |Hard links are not allowed for directories* |Soft links can be used for linking directories | |
|File system |It cannot be used across file systems |It can be used across file systems | | |File system |It cannot be used across file systems |It can be used across file systems | | ||
|Data |Data present in the original file will still be available in the hard links |Soft links only point to the file name, it does not retain data of the file | | |Data |Data present in the original file will still be available in the hard links |Soft links only point to the file name, it does not retain data of the file | | ||
|Original file’s deletion |If the original file is removed, the link will still work as it accesses the data the original was having access to. |If the original file is removed, the link will not work as it doesn’t access the original file’s data. | | |Original file’s deletion |If the original file is removed, the link will still work as it accesses the data the original was having access to. |If the original file is removed, the link will not work as it doesn’t access the original file’s data. | | ||
|Speed |Hard links are comparatively faster |Soft links are comparatively slower | | |Speed |Hard links are comparatively faster |Soft links are comparatively slower | | ||
+ | Notes: | ||
+ | *Inode number – Index node number is a unique number assigned to all files in a Linux/Unix system. | ||
+ | *Hard links on directories can cause fundamental problems. | ||
Soft symlink ownership is not particularly important as it has full permissions (777) and file access is determined by real file permissions. | Soft symlink ownership is not particularly important as it has full permissions (777) and file access is determined by real file permissions. | ||
+ | |||
+ | In general soft links are more flexible, however hard links on files do have specific use cases. | ||
+ | *Incremental back-ups, use of hard links saves duplicating file data | ||
+ | *Virtual File systems where source soft link directions do not resolve. | ||
+ | |||
+ | ---- | ||
+ | ====Link Tools==== | ||
+ | *Use the '' | ||
+ | *'' | ||
---- | ---- | ||
====References==== | ====References==== | ||
- | *[[http:// | + | *[[http:// |
- | *[[https:// | + | *[[https:// |
+ | *Linux Handbook [[https:// | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
+ | *[[https:// | ||
---- | ---- | ||
<- home_server: | <- home_server: |