I tried to clear the content of error.log file on my apache server with commands
sudo >error.log sudo truncate -s0 error.log
But in both cases I got
-bash: error.log: Permission denied.
I tried the same thing while stopping apache, but still got the same message. After that I tried to clear it with
sudo nano error.log and was able to remove everything.
So why was not I able to clear the log properly?