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

Undraw File Manager Re Ms29

About

A soft link, symlink or a symbolic link is a file that redirects (link) to another file.

It's the alias functionality of a file system.

Unlike a hard link, a symbolic link can link to any file on any computer.

Operating System

Linux

Creation

They are created with the ln command.

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

ln -s /the/full-real/file/path /the/sym/link/file/path
ln -s /the/full-real-path/to-directory /the/symlink/directory/path
ln -s /etc/dbora /etc/rc.d/rc2.d/S99dbora

See canonical/real path:

readlink -f /the/sym/link/file/path

Remove Without trailing slash:

  • unlink
unlink /the/sym/link
  • or remove
# rm /the/sym/link/ <- Bad
rm /the/sym/link

Target

Target of symlink can be:

Windows

Symlink are also known as junction on Windows.

Dos

Windows shortcut are not symbolic link

mklink
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  targetSymlink sourceFile 
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
mklink  /D symlink directory 
REM example for the preferences directory of Eclipse
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

  • List: the dir command show the target of symbolic links (called Reparse Points)
dir /a:l
/A          Displays files with specified attributes.
  attributes   D  Directories                R  Read-only files
               H  Hidden files               A  Files ready for archiving
               S  System files               I  Not content indexed files
               L  Reparse Points             -  Prefix meaning not

Powershell

Security and Developer Mode

On Windows, you can activate Developer Mode to allow non-admin users to create symlinks by following this instructions.

1)





Discover More
Bash Liste Des Attaques Ovh
Bash - Cd (Change Directory) builtin command

in bash. Cd is a builtin command that changes the current directory where: the options -L forces symbolic links to be followed. -P says to use the physical directory structure instead of...
Card Puncher Data Processing
Dos - (Batch) Script

The batch script is a text file with the extension .bat or .cmd that is interpreted by a batch interpreter. You can call a batch script by : writing its name in the source script: The script execution...
Card Puncher Data Processing
Dos - Dir

Dir displays a list of files and subdirectories in a directory. where the options without extra attributes are: Options Description [drive:][path][filename] Specifies drive, directory, and/or...
Undraw File Manager Re Ms29
File (System, Transfer, Storage)

This section is based on the File data structure. A file is: a logical grouping of related data (at the cluster size) identified through a path managed through a file system transferred through...
Undraw File Manager Re Ms29
File System - Hard link (Alias)

File alias. By contrast, a soft link (symbolic link) on such file systems is not a link to a file itself, but to a file name. This creates aliasing, but in a different way. Unlike a hard link, a symbolic...
How to disable your firewall in rescue mode ?

When working with firewalls, the unexpected can happen and you can be locked out of your server or vps. Many VPS provider provides a rescue mode that permits to rescue your server. This how-to shows you...
Card Puncher Data Processing
Idea Plugin Dev - File and File System (Virtual)

A virtual file com.intellij.openapi.vfs.VirtualFile...
Inkscape Layout
Inkscape - Installation and configuration

The installation is straightforward on Windows. C:\Users\UserName\AppData\Roaming\inkscape\preferences.xml can be moved via symlink to a backup location:
Javascript - MonoRepo

in the Javascript context When starting with monorepo, integrate first the leaf projects of the dependency graph (ie project without dependency). To use the library locally without publishing to...
Javascript - pnpm

pnpm is a Javascript package manager pnpm differs from the other package manager via the structure of the node_modules folder where: the directory structure is flat with one dependency by directory...



Share this page:
Follow us:
Task Runner