Post

Symbolic Link / Symlink

Symlink:

Symlink is a type of file that’s used to point to another file/directory. It contains a text string that’s automatically interpreted and followed by the OS as a path to another file/directory.

  • The source file/dir is called a target.
  • Example use case: if you want your game’s save file to be stored in /hardDisk/saveFile then create a symlink from /saveFolder/saveFile to the new location.
  • Symlinks are of two types:
    1. Soft Links: Points to the original file > Original File points to the inode
    2. Hard Links: Points to the inode itself
  1. Soft Links:
1
2
3
4
5
6
#create
ln -s ~/path/to/original ~/symlinkFile
ln -s '/path/to/original with spaces' '/path/to/link with spaces'

#delete
rm -rf ~/symlinkFile
  1. Hard Links:
1
ln ~/path/to/original ~/symlinkFile
This post is licensed under CC BY 4.0 by the author.