Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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? – アレックス 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 ? – アレックス 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. – アレックス Nov 26 '13 at 8:21

Your Answer


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.