Alias vs. Symlink
It is possible to create smaller links to files on your computer.
Symbolic links, or symlinks, store the path of a file and are generally much smaller than an alias. It's important to note that a symbolic link may break if the source file is moved, or if the symlink is moved, depending upon how the link is configured.
To create a symlink, you may use the terminal and type:
Code:
ln -s $source_file $target_file; # Create a symbolic link
stat -x $target_file; # Display information about the link
readlink $target-file; # Display the destination of the link
readlink $target-file | tr -d '\n' | wc -c; # Count the number of characters in the destination, excluding newlines
If you were to run the above code, replacing the `$source_file` variable with a real file path, and the `$target_file` variable with the path of the link you wish to create, you might notice that the size of the link (as displayed by `stat`, and the number of characters in the destination path are identical. This serves to illustrate that symbolic links are little more than simple paths.
An
alias, on the other hand, creates a dynamic link which will remian valid even if the source file, or alias, is moved.
One important concept to understand is, to quote Wikipedia, that "an alias is implemented as a file on the disk that must be interpreted by Mac API while links are implemented within the filesystem and are thus functional at any level of the OS." Thus, symlinks are generally transparent to the filesystem, while aliases work better with the GUI. Therefor, both file types have the distinct advantages, however aliases are probably better for the typical end user.