使用sudo在文件中添加内容
$ echo "export PATH=$PATH:/opt/bin" >> /etc/profile
-bash: /etc/profile: Permission deniedecho "export PATH=$PATH:/opt/bin" | sudo tee -a /etc/profilesudo bash -c "echo 'export PATH=$PATH:/opt/bin' >> /etc/profile"参考
Last updated