How To Remove Symbolic Links In Linux?

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/remove-symbolic-links-linux/
PINTEREST
PINTEREST
INSTAGRAM

Symbolic links provides practical solutions file name or path related problems. Symbolic links will create same file or folder with different name and path. In some situations this may cause problem and we have to remove and delete symbolic link.

List Symbolic Links

We can start by listing existing links especially symbolic links with ls command like below. Symbolic links provide some redirect to the source file like symbolic link RealInput.

List Symbolic Links

List Symbolic Links

Remove Symbolic Links

There are different ways to remove symbolic link. We can just issue rm command to the link file. In this example we will remote link named RealInput .

Remove with unlink Command

As we use ln command which is shortcut for link we have also command named unlinkwhich can unlink given links. In this example we can remove RealInput like below. unlink command is an alias for rm command.

Remove Symbolic Links with sudo for “Permission Denied” Error

Some symbolic links may be created by privileged user like root . If we try to remove this links with regular or less privileged user we will get an error like permission denied . So in order to remove this symbolic links we need to provide sudo command at the beginning of the command like below.

Remove Hard Links

We can easily remove hard links with the same commands too.

OR

LEARN MORE  How To Remove Files Older Than 1 Day Recursively

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/remove-symbolic-links-linux/
PINTEREST
PINTEREST
INSTAGRAM

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)