Attempting to create a symbolic link for the subl command so that I can open flies in Sublime Test 3 from the terminal. However, it fails to find the /usr/local/bin directory, even though it is in my path.
$ ln -s /D/ProgramsD/SublimeText3/subl /usr/local/bin/subl
ln: failed to create symbolic link '/usr/local/bin/subl': No such file or directory
The only way to fix these broken symlinks is by deleting them. Your system contains hundreds of dangling links and no one has the time to check for these links manually. In such cases, Linux tools and commands prove to be really helpful.
You can create a symlink (symbolic) by using the ln command in the command line. Symbolic links are useful because they act as shortcuts to a file or directory.
A symlink is broken (or left dangling) when the file at which it points is deleted or moved to another location. If an application's uninstallation routine doesn't work properly, or is interrupted before it completes, you might be left with broken symlinks.
Create Symbolic Link in Linux for Files There is nothing hard in creating Symbolic links in Linux – you just need to follow one simple step. The ln command in Linux creates links between source files and directories. -s – the command for Symbolic Links. [Symbolic filename] – name of the symbolic link.
ln: failed to create symbolic link '/usr/local/bin/subl': No such file or directory
This error can happen when one of the parent directories of /usr/local/bin/subl
don't exist.
Create them with:
mkdir -p /usr/local/bin
However, it fails to find the
/usr/local/bin
directory, even though it is in my path.
As the output of ls -ld /usr/local/bin
reveals,
indeed there is no such directory.
The fact that the directory is on your PATH
is irrelevant,
because being on the PATH
doesn't imply that a directory actually exists.
In your example it doesn't exist, you need to create it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With