Delete directory by referencing symbolic link
- by Adam
To set up the question, imagine this scenario:
mkdir ~/temp
cd ~/
ln -s temp temporary
rm -rf temporary, rm -f temporary, and rm temporary each will remove the symbolic link but leave the directory ~/temp/.
I have a script where the name of the symbolic link is easily derived but the name of the linked directory is not.
Is there a way to remove the directory by referencing the symbolic link, short of parsing the name of the directory from ls -od ~/temporary?