Why when I run I get the error:
$ sudo echo "127.0.0.1 db-local.internal" >> /etc/hosts
bash: /etc/hosts: Permission denied
But when I do sudo su
I can edit this file without any problem.
UPD
Because question is closed I add answer here:
sudo bash -c "echo 'some string' >> test.txt"