1. After upgrading Mac OS X 11, you want to copy files to the system directory.
sudo cp-f test.txt/usr/bin/
2、I found that even with permission sudo, there are also permission problems.
CP:/usr/bin/test:operation not permitted
3. The reason is that after upgrading Mac OS X 11, El Capitan has added the Rootless mechanism. It is no longer possible to edit any path at will, even if root permissions are set.
ps: Rootless mechanism is used to resist malicious programs.
4. Rootless mechanism needs to be disabled for the copy under bin directory.
5. Restart Press and hold Command + R to enter recovery mode.
6. Then open Terminal and enter: csrutil disable.
ps: When not needed, you can turn on csrutil enable again, after all, it is a protection mechanism.
This article comes from the "Going Upward Dream" blog, please keep this source http://mandyc.blog.51cto.com/1230448/1980146