@b0rk One thing that confuses people is the combination with user permissions.
```
sudo cat ~/allowed_file > /root
```
doesn't work because the user's shell runs the `>` redirection, and it doesn't have permissions to write to `/root`. The `sudo` part is useless, as the user is allowed to read the file anyway.
Instead, the output needs to be piped into a tool running as the appropriate user.
I tend to use `tee` for that. It's main purpose is to duplicate a stream to both 1) stdout and 2) a file, but here, we want 2), run as root.
```
cat ~/allowed_file | sudo tee /root >/dev/null
```
The redirection is for the output from 1), as it's not needed here.