How To: Linux Delete Symbolic Link ( Softlink )

How To: Linux Delete Symbolic Link ( Softlink )

To delete a symbolic link (also known as a "soft link") in Linux, use the rm command with the -f option to force the deletion, and the name of the symbolic link as the argument. For example:

rm -f mylink
Source:‮tual.www‬turi.com

Alternatively, you can use the unlink command to delete the symbolic link, like this:

unlink mylink

Keep in mind that deleting a symbolic link does not delete the target file or directory that the link points to. Only the link itself is removed.

If you want to delete the target file or directory, you will need to use the rm command on the target file or directory itself. For example:

rm -rf mydir

This will delete the directory named "mydir", along with all of its contents. Be careful when using the rm command, as it can permanently delete files and directories and is not reversible.

Created Time:2017-10-29 22:08:34  Author:lautturi