It's not actually locked, you just don't have permission to edit it. Instead, use a command-line text editor like vim
to edit this file.
Use sudo vim /etc/paths
to edit the file from the command line. Press i to start typing (navigate with arrow keys), press Esc when done. Then type :wq
and Return
Note that in many situations, it's easier to add executable paths to a user-specific configuration file, like ~/.bash_profile
, or add new files in /etc/paths.d
with additional paths.