1833873 Members
1653 Online
110063 Solutions
New Discussion

Re: Remove a link

 
Ramesh_1
Occasional Advisor

Remove a link

Hi All,

I'm trying to remove a link which has lost its link.
Here it is
~~~~~~~~~~~~~~~~~~~
lrwxrwxrwx 1 root root 20 Feb 24 03:55 download
~~~~~~~~~~~~~~~~~~~~~~

Notice that the link is missing and the link cannot be removed.

Please enlighten on how to remove this link.

Thanx in advance
Ramesh
Whatever it takes !
8 REPLIES 8
John Carr_2
Honored Contributor

Re: Remove a link

Hi

have you tried the force option

rm -f download

logged in as root of course

cheers
john.
Steven Gillard_2
Honored Contributor

Re: Remove a link

Running the 'unlink' command as root will take care of it.

Regards,
Steve
Clemens van Everdingen
Honored Contributor

Re: Remove a link

Hi,

what error you are getting ?

Try creating a bogus file the link was used to have.
And then rm the link as root.
Maybe use unlink as latest option.

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
Heiner E. Lennackers
Respected Contributor

Re: Remove a link

Hi,

you can just delete the link which "rm".
If it points to a directory, just must NOT add the / !!
# rm download
should work fine.
You may also try the "unlink" command:
# unlink download

Heiner
if this makes any sense to you, you have a BIG problem
John Carr_2
Honored Contributor

Re: Remove a link

Hi

also you cannot remove it if its being accessed.

fuser -c /download

Then do

fuser -k


cheers
John.
John Strang
Regular Advisor

Re: Remove a link

Hi Ramesh,

Do you get an error when you try to remove the link? If so can you please let us know what the error is?

It should be possible to remove it as you have full permissions, but not if the file is in use by any process.

HTH,

John
If you never make a mistake you'll never make anything.
Ramesh_1
Occasional Advisor

Re: Remove a link

Hi ,

Tried the suggestions.But didn't work.

A reboot of the server took care of the problem. Quite drastic though.

Thanx
Ramesh

Whatever it takes !
steven Burgess_2
Honored Contributor

Re: Remove a link

Ramesh

whilst on the topic of links

I've found a command that will search for all dead links on a system

find -type l -print | perl -nle ' -e || print ' > /tmp/deadlinks

Regards

Steve
take your time and think things through