Delete Symbolic Link or Softlink Linux

Friday, October 17, 2014

How To Delete Symbolic Link or Softlink in Linux, Centos, Ubuntu using command prompt ?

following command to remove symbolic links:-

1st rm - removes each given FILE including symbolic links
2nd unlink - deletes a single specified file name including symbolic links.

Delete Symbolic Link File :-

following syntax:

rm linkname
unlink linkname

Example:-

cd /tmp
ln -s /etc/resolv.conf mytest
ls -l mytest

output -
lrwxrwxrwx 1 user user 16 2008-12-16 08:27 mytest -> /etc/resolv.conf


Now delete dns symbolic link:
rm dns
OR
unlink dns


Delete Symbolic Link Directory :-

following syntax:-

rm linkDirName
unlink linkDirName

Example:-
cd /tmp
ln -s /etc test
ls -l test
Sample Output:

lrwxrwxrwx 1 user user 4 16 2008-12-16 08:27 test -> /etc

Now delete test symbolic link directory:
rm test
OR
unlink test

0 comments:

About This Blog

Lorem Ipsum

  © Copyright 2009 Linux-HelpLine.Blogspot.com

Back to TOP