after open "vim" editor by termnial try to save the path enviroment when write ":qw" it's print error:
vim when save print "/etc/paths" E212
after open "vim" editor by termnial try to save the path enviroment when write ":qw" it's print error:
vim when save print "/etc/paths" E212
Your system comes with a number of executables by default, placed in a number of standard directories.
When a program is executed in a shell, say $ vim
, the shell tries to find a vim
executable in those directories and then tries to execute the first one it found, if any.
Those standard directories, listed in /etc/paths
, are all owned by root
because allowing any less privileged process to remove or add or change anything there could have very bad consequences.
/etc/paths
is also owned by root
because messing with that file could also have very bad consequences, from making default programs inaccessible to overriding them with malevolent ones.
It is thus not a good idea at all to change the file's permissions.
If you really want to, say, add a directory to that file, then the only appropriate method is to do it "as root
", with $ man sudo
(recommended reading):
$ sudo -e /etc/paths
"/etc/paths" E212: Can't open file for writing Press ENTER or type command to continue
Not have permission to edit
sudo chmod -R 777 /etc/paths
1- Search for file by finder >> go >> type “/etc/paths/“
2- Then right click on file >> file info >> permission >> click icon add (+)
3- select your account and give access read and write