I know we can use below format to redirect the screen output to a file:
$ your_program > /tmp/output.txt
However when I used below command, it says "-bash: /home/user/errors.txt: Permission denied"
sudo tail /var/log/apache2/error.log > ~/errors.txt
May I know how to make this output works? The ~/errors.txt doesn't exist. Do I need to create this txt file first before IuseI use the redirect command?