I stupidly used my terminal to create a symbolic link typing this:
sudo ln -s /bin/tcsh tcsh
And now I need to delete it. I tried
sudo rm tcsh
but when I authenticate it tells me:
override rwxr-xr-x root/wheel restricted,compressed for tcsh?
and even if I type y and press enter it tells me:
rm: tcsh: Operation not permitted.
Is there anything I can do to fix this?
Best Answer
It seems you are either trying to remove your original file /bin/tcsh or another tcsh copied to a different path. You can't link /bin/tcsh to tcsh if you are in the /bin folder because that's forbidden.
A soft link of tcsh usually isn't protected by SIP and you have to search for it and delete it. If you somehow managed to copy tcsh to another path, which then prevents a software you are using from working, you may have to delete it there.
To remove a protected tcsh copy, boot to Recovery Mode, disable SIP, reboot to your main volume and remove the link.
csrutil disable
and press Enter.csrutil enable
and press Enter.Link: How do I disable System Integrity Protection (SIP) AKA “rootless” on OS X 10.11, El Capitan? This is also valid for macOS Sierra!