日々精進

新しく学んだことを書き留めていきます

2014-09-06から1日間の記事一覧

sudo echo "append" >> /etc/environmentのようにファイルに文字列を追加しようとするとPermission deniedになる

この場合、以下のようにすると文字列を追加できる。 sudo bash -c "echo 'test' >> /etc/file"sudo bash -cをpipeの後のコマンドもsudo権限で実行されるのか。なるほど。 参考:linux - Permission denied when trying to append a file to a root owned fil…