1. 程式人生 > >避免 ‘sudo echo xxxx >’ 時候 出現 “permission denied”

避免 ‘sudo echo xxxx >’ 時候 出現 “permission denied”

➜  ~ echo "/opt/nfs 10.10.10.*(rw,all_squash,sync)">>/etc/exports zsh: permission denied: /etc/exports     解決辦法: 1) sudo sh -c ' echo "/opt/nfs 10.10.10.*(rw,all_squash,sync)" >> /etc/exports   2) echo "/opt/nfs 10.10.10.*(rw,all_squash,sync)" |sudo tee /etc/exports
     echo "/opt/nfs 10.10.10.*(rw,all_squash,sync)" |sudo tee -a /etc/exports    -a:append 追加   3)提升許可權