I created a file with sudo like this:

sudo touch abc.txt

Which understandably set the owner to root. Now when I try to edit the file via vi using sudo, it works:

sudo vi abc.txt #works

But when I do something like

sudo cat > abc.txt

It gives me the permission error.

Browse other questions tagged or ask your own question.