Deleting symbolic link - operation not permitted 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?
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.


Reboot your Mac into Recovery Mode by restarting your computer and holding down Command+R until the Apple logo appears on your screen.
Click Utilities > Terminal.
In the Terminal window, type in csrutil disable and press Enter.
Restart your Mac.
Remove the tcsh copy
Reboot your Mac into Recovery Mode
Click Utilities > Terminal.
In the Terminal window, type in csrutil enable and press Enter.
Restart your Mac.


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!