Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a folder with many files those have a few sym links pointing to them like

/some_path -> /dir/file1
/some_path2 -> /dir/file2
/some_path3 -> /dir/file3

But I don't remember neither the some_paths no which files from dir have sym links pointing to them.

Now I need to delete dir (I really need it for some reason). And I also want no file to point to any file from dir since I'll delete it.

How do I unlink those files? What if I just delete dir, will they unlink by themselves?

share|improve this question

1 Answer 1

To unlink files,

unlink /path/to/the/link_file

If you delete the dir it doesn't unlink themselves.And if you click on the link after deleting dir,it will shows like this,

enter image description here

share|improve this answer
    
what's /path/to/the/link_file according my question: /some_path or /dir/file1? –  Alex Nov 26 '13 at 8:04
    
you doesn't know where the link was located. –  Avinash Raj Nov 26 '13 at 8:07
    
no, I don't. So how can I unlink /path/to/the/link_file then if I don't know what /path/to/the/link_file is ? –  Alex Nov 26 '13 at 8:08
    
If a link was created on Downloads folder for an avinash folder in desktop.Then removing the link by running this command. unlink ~/Downloads/avinash –  Avinash Raj Nov 26 '13 at 8:19
    
I know only path to dir and nothing else. –  Alex Nov 26 '13 at 8:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.