How to remove symbolic link in Mabox Linux (Manjaro)

Written by Administrator on Thursday April 9, 2020

Before we remove a symbolic link (also called symlink) in Mabox Linux, we have to ensure, that link really exists. In Linux you (normally) don't see file extension, so, first, check, what contains symlink:

I have (I hope, we will check it) I have a symlink "/usr/bin/node", because I write

$ node --version

and receive this output:

But I know, it not a directory nor a file. And surely, before we remove something in our system, let's check, whether it's a link:

$ ls -l /usr/bin/node

output:

lrwxrwxrwx 1 root root 53 Apr  9 18:14 /usr/bin/node -> /home/dima/Downloads/node-v12.16.2-linux-x64/bin/node

What does it mean? It means, that symbolic link "/usr/bin/node" points to "home/dima/Downloads/node-v12.16.2-linux-x64/bin/node" program. In output you see symlink (/usr/bin/node), which points to a file (path after "->" symbol).

Ok, now we know, that /usr/bin/node is a link. Our goal is to remove it. Let's use commonly known command rm with parameter -i:

$ rm -i /usr/bin/node

system will ask us for confirmation of what we are doing:

It's done. Symlink is deleted. Let's check it:

$ node --version

output is:

[dima@dima-edustorage-net bin]$ node --version
bash: node: command not found

Command not found. It means, our system doesn't know, what "node" command is anymore.

Category: linux Tags: mabox-linux symlinks rm