Ravi Sir's Cards › AWS
sudo echo > file fails?
This interview card answers: sudo echo > file fails? The shell opens the file as you. Use sudo tee instead. Append as root.
Read card text
What this card says
What it is
The shell opens the file as you.
Why it matters
Use sudo tee instead.
How / example
Append as root.
echo 10.0.0.5 db > line.txt; sudo tee -a /etc/hosts < line.txt