Use sudo tee when piping output

Otherwise sudo would only apply to the command, not for the redirects (>,  and >>)