Wednesday, September 9, 2015

linux - Unlink (remove) directory symlink


I did:


ln -s /DATA/ ./base_DATA/

and I'd like to unlink. Simply:


unlink ./base_DATA

but... unlink: cannot unlink './base_DATA': Is a directory


According to this answer (and many other online) the problem is usually the trailing space in the unlink command. But I get this error regardless.


Any ideas how to tackle this?


Answer



./base_DATA/ is a normal directory that existed before. Your ln command created a symlink inside it. The symlink is ./base_DATA/DATA. You can unlink it:


unlink ./base_DATA/DATA

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...