Linux remove symbolic link

 

Linux remove symbolic link.

 

   What command need to issue to make Linux remove symbolic link?  The step by step article on Linux remove symbolic link below show the command example need to issue to remove symbolic link on Linux system.  Please note that the symbolic link just a link to the target file or directory.  The symbolic link never share same inode with the original file, so if we remove the symbolic link they do not have any effect to the original file or directory... its just like remove the shortcut (link) to the file.  The example below use unlink command to remove the symbolic link, and use rm command achieve same result. 

 

Remove symbolic link

 

1.  Log in to Linux system.

 

2. Check and verify symbolic link need to remove by execute ll command (or ls -l --color=auto command) as show on example below.

List all symbolic link

[linux@fedora11 ~]$ ll

total 32

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Desktop

lrwxrwxrwx. 1 linux linux   16 2010-04-25 17:37 dns -> /etc/resolv.conf

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Documents

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Download

lrwxrwxrwx. 1 linux linux    5 2010-04-26 19:52 e -> /etc/

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Music

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Pictures

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Public

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Templates

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Videos

[linux@fedora11 ~]$

 

3. Type unlink command with the symbolic link filename (dns) that need to remove and hit 'Enter' key.

remove symbolic link with unlink command

[linux@fedora11 ~]$ unlink dns

[linux@fedora11 ~]$

 

4. or you can use rm command to remove symbolic link (e) as we already achieve with the unlink command on above command example.

Linux remove symbolic link

[linux@fedora11 ~]$ rm e

[linux@fedora11 ~]$

 

5.  Verify that we already remove the symbolic link by executing ll command again (or ls -l --color=auto command).

Step by step remove symbolic link command example

[linux@fedora11 ~]$ ll

total 32

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Desktop

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Documents

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Download

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Music

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Pictures

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Public

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Templates

drwxr-xr-x. 2 linux linux 4096 2010-03-20 22:32 Videos

[linux@fedora11 ~]$

 

Keywords: linux remove symbolic link, remove symbolic link, remove link, symbolic link remove, unlink file, linux unlink, linux symbolic link remove, symbolic link remove