How do I unlink directories created with ln -f?

Guy Cardwell gcardwel at polaris.acs.uci.edu
Thu Jun 28 15:49:40 AEST 1990


I have created a mess.  Playing the curious Unix hacker, I created a directory,
and then created a hard link to that directory using ln -f.  Now I have
a problem.  I can not seem to get rid of either of the directories.  I am
running SunOS 4.0.3.  I have tried to delete the directories with the following
as root:

rm -r dir1
rmdir dir1
unlink dir1

The man page for unlink implies that unlink is almost a sure kill... it even
warns that you should be careful about this, as all of the files in the
directory would be lost... it does not however get rid of the directories.

This link count on both of the directories is 3. (. .. other directory) 
Nothing seems to be convinced that the directories are empty..

Short of dump/restore, I dont know what to do.  Any ideas??

Guy



More information about the Comp.unix.wizards mailing list