Symbolic links are like shortcuts in Linux, which can point to either files or directories located on the same computer, on another device, or somewhere across the network. They are incredibly useful, but unlike hard links, symbolic links do not automatically update if the target file or directory is moved. This can create broken links that point to locations that no longer exist. Fortunately, deleting these broken links is a simple process.
- Skill level:
Other People Are Reading
Open a terminal window so you can work from the command line.
Navigate to the directory containing the bad symbolic link by typing "cd <DIRECTORY>" and pressing "Enter."
Type "ls -lha <LINK>" if you want to see what the symbolic link points to. It will look like this:
<LINK> -> <DESTINATION>
Type "rm <SYMBOLIC LINK>" and press "Enter." This will delete the symbolic link.
Tips and warnings
- If you know exactly where the symbolic link is located, you can simply type "rm //" and press "Enter." This will delete the link without your having to navigate to it.
- The "rm" tool will not ask for confirmation before deleting unless the "-i" option is used. Be absolutely sure you wish to delete something before you press "Enter." Items deleted with this tool will not be sent to the trash folder.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for