I'm using Amazon Linux. I'm trying to append some text onto a file. The file is owned by root. I thought by using "sudo", I could append the needed text, but I'm getting "permission denied", see below
[myuser@mymachine ~]$ ls -al /etc/yum.repos.d/google-chrome.repo
-rw-r--r-- 1 root root 186 Jul 31 15:50 /etc/yum.repos.d/google-chrome.repo
[myuser@mymachine ~]$ sudo echo -e "[google-chrome]\nname=google-chrome\nbaseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch\nenabled=1\ngpgcheck=1\ngpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub" >> /etc/yum.repos.d/google-chrome.repo
-bash: /etc/yum.repos.d/google-chrome.repo: Permission denied
How can I adjust my statement so that I can append the necessary text onto the file?