I want to do:
echo "something" >> /etc/config_file
But, since only the root user has write permission to this file, I can't do that. But the following also doesn't work.
sudo echo "something" >> /etc/config_file
Is there a way to append to a file in that situation without having to first open it with a sudo
'd editor and then appending the new content by hand?
ls
with directory path shows files, butls
with file pattern does not?sudo -i
first. However, I came to this thread to find a solution that avoids doing that, so I won't leave it as an answer.