Getting rid of a locked file

  • johne53
Posted: Thu, 09/04/2008 - 15:49
I accidentally created a symbolic link which I don't need. Unfortunately, it seems to have acquired a padlock symbol in the bottom left-hand corner and I can't move it to the waste bin. Even if I log in as root, I still can't delete the file. How do I remove the lock, please?

Thanks Dave. Strangely

  • johne53
  • 10/07/07
  • Fri, 09/05/2008 - 10:57
Thanks Dave. Strangely enough it belongs to me (I log in as johne53) and it's part of the "staff" group. I'll try the live CD approach a bit later (I think I've got a live CD of Ubuntu floating around somewhere). I created the file accidentally when trying to make a symbolic link to a folder. The folder was called Ardour Sessions so I should have enclosed the path in quotes, like this:- ln -s "/path/to/Ardour Sessions" /usr/local/bin Unfortunately, I missed out the quote marks and I ended up with 2 symbolic links - one called Ardour and the other called Sessions. It's the one called Sessions that I can't delete. [Edit...] I booted up using my Ubuntu live CD and fortunately, I was able to delete the dodgy link. Thanks for the suggestion Dave.

who owns the file?

  • skullnotions
  • 09/29/07
  • Fri, 09/05/2008 - 06:58
If you can't "rm"..."mv" or edit the file who does it belong to? what does, $ ls -l show? What about using a livecd, login as root and try to delete it? Cheers, dave.

Thanks for the suggestions

  • johne53
  • 10/07/07
  • Thu, 09/04/2008 - 19:05
Thanks for the suggestions Quentin, but no luck.... :-( Everyone's permissions seem to be set to read, write and execute but no properties at all can be changed - not even by root..! I tried sudo nautilus and I even tried logging in as root but the file remains stubbornly locked. Apart from the padlock though, nothing else looks in any way unusual.

Check the owner...

  • Quentin Harley
  • 05/24/07
  • Thu, 09/04/2008 - 17:22
Right click on the file you want to delete, and select properties. Under permissions, it should give the owner and the permissions. If you are the owner, enable the werite permission, and delete the link. if not do this in a terminal ~$ sudo nautilus It starts nautilus with root rights. Now there should be no padlock. Delete the file, and then visit the root trash by clicking on "Go" --> "Trash" in the menu of that naulus. Here you should see the file again. Delete. Hope it helps you