Skip to main content
edited tags
Link
Gilles 'SO- stop being evil'
  • 865.4k
  • 205
  • 1.8k
  • 2.3k
Tweeted twitter.com/#!/StackUnix/status/182023602458214400
spelling, syntax
Source Link
user unknown
  • 10.8k
  • 3
  • 37
  • 59

Command tail Outputprogram output to Filefile in linuxLinux

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?

Command tail Output to File in linux

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 Iuse the redirect command?

tail program output to file in Linux

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 I use the redirect command?

Source Link
Xianlin
  • 1.1k
  • 5
  • 15
  • 20

Command tail Output to File in linux

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 Iuse the redirect command?