Score:0

How to >> as sudo?

cn flag

I am trying to understand why this simple command does not work.

sudo echo "a" >> /var/log/a.txt

It returns.

-bash: /var/log/a.txt: Permission denied

But I do have permission to rw by other means, for example editing it with nano

sudo nano /var/log/a.txt

or by being logged into root

sudo su -
echo "a" >> /var/log/a.txt

How can I "apply sudo" to >>?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.