On the bash command line, I am in a directory with permissions rwxrwxr-x
with an owner and group named web
. When I use the command sudo touch foo
, the file has an owner and group of root
as expected. But when I use the command sudo ls > bar
, the file has an owner and group of web
which I did not expect. Why is this?