How to copy file to /usr/share on mac?
Solution 1
It looks like the problem you are having is more related to installing Vim colorschemes.
Those can be installed in ~/.vim/colors/
.
mkdir -p ~/.vim/colors
cp ~/Downloads/kellys.vim ~/.vim/colors/
And then set it with
:colorscheme kellys
Update
If you really want your file in /usr
, then the permissions on that folder are on lockdown and you can't edit it without disabling System Integrity Protection (SIP).
A folder that you can modify, however, is /usr/local/share
.
So you can instead do
cp ~/Downloads/kellys.vim /usr/local/share/vim/vim73/colors/
Solution 2
U need to disable System Integrity Protection.
- restarting and use Command ⌘-R on boot
- open a terminal and execute command:
csrutil disable
- restart normally
- NOW u can write in /usr dir tree
- (optional) restart again, use Command ⌘-R on boot and execute again
csrutil enable
Related videos on Youtube
doouding
Updated on September 18, 2022Comments
-
doouding over 1 year
I try to copy some file to /usr/share folder, but the terminal said that operation not permitted even I do the with sudo.
sudo cp ~/Downloads/kellys.vim /usr/share/vim/vim73/colors/
the result
cp: /usr/share/vim/vim73/colors/kellys.vim: Operation not permitted
When I try to change the permission of this folder, it came with the same problem. I run EI Capitan on Mac. I have google it for a long time,but still confused. How do I solve the problem ?-
kenorb over 8 yearsPaste exact command that you run and exact output/errors you've got, it'll be easier to understand what you're trying to do.
-
blm over 8 yearsBeing you're running El Capitan, it's probably SIP's fault. You can disable SIP, but a better solution is the one in cricket_007's answer below.
-
-
doouding over 8 yearsthanks, but I really want to figure out this problem.
-
OneCricketeer over 8 yearsLet me know if the update helps
-
Jiraheta almost 3 yearsNot sure why it downvoted but this is exactly what I was looking for. I actually needed to add something to /usr/bin not particularly just /usr So, you are back to whole. Thanks.