Sym links are “symbolic” links. Its a symbolic link to a real file or folder. The symbolic part is just a representation of a file, not a real file.
- Move your file or folder to its new location
- Create your symbolic link to the file
This is good for security because you can set more lineant permissions on the symbolic file
Structuring you symbolic link
ln
Stands for link -s
Stands for symbolic
Here we create a new symbolic link in the current directory to /path-to-file/
1
| ln -s /path-to-file/ name-of-symbolic-file
|
examples
1
| sudo ln -s /var/www/test.eample.site/ my-link
|
1
| sudo ln -s /var/www/test.example.site/web/ my-link
|
Create a symbolic link:
1
| ln -s [target file or directory] [symlink name]
|
Example
1
| ln -s /path/to/file /path/to/symlink
|
List symbolic links in a directory:
Find broken symlinks:
1
| find /path/to/search -xtype l
|
Remove the symlink using the rm command.