File System - (Symbolic|ln|Soft) link - File Alias - Symlink

> File (System, Transfer, Storage)

1 - About

Alternatively referred to as a soft link or symlink, a symbolic link is a file that links to another file using the path. Unlike a hard link, a symbolic link can link to any file on any computer.


3 - Operating System

3.1 - Linux

They are created with the ln command .

They are created with the ln command and the -s parameter:

ln -s /etc/dbora /etc/rc.d/rc2.d/S99dbora
ln -s /the/real/fle /the/sym/link

Remove Without trailing slash:

# rm /the/sym/link/ <- Bad
rm /the/sym/link

3.2 - Windows

Windows shortcut are not symbolic link

Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

        /D      Creates a directory symbolic link.  Default is a file
                symbolic link.
        /H      Creates a hard link instead of a symbolic link. (Works only with files ? See option /D)
        /J      Creates a Directory Junction.
        Link    specifies the new symbolic link name.
        Target  specifies the path (relative or absolute) that the new link
                refers to.

Example for:

  • a file
mklink  sourceFile targetSymlink
REM with a php ini file
mklink  C:\php-7.2.6-Win32-VC15-x64\php.ini D:\repo_backup\php.ini
symbolic link created for C:\php-7.2.6-Win32-VC15-x64\php.ini <<===>> D:\repo_backup\php.ini
  • A directory: the preferences directory of Eclipse:
mklink  directory symlink
mklink /D "D:\workspace\.metadata\.plugins\org.eclipse.core.runtime" "D:\svn\Config\Eclipseorg.eclipse.core.runtime"
symbolic link created for D:\workspace\.metadata\.plugins\org.eclipse.core.runtime <<===>> D:\svn\Config\Eclipse\org.eclipse.core.runtime

4 - Documentation / Reference

file/symbolic_link.txt · Last modified: 2019/05/19 11:22 by gerardnico