试图追踪apache日志中的模糊错误

I am trying to stamp out errors on a new Ubuntu server install and am getting errors in the logs that I have no clue on how to track down.

The logs show this line over and over

sh: 1: cd: can't cd to ~
sh: 1: cd: can't cd to ~
sh: 1: cd: can't cd to ~
sh: 1: cd: can't cd to ~

How do I find the source from such a vague error? It does not even have a time of occurrence that most errors in the logs have.

Thanks in advance. It is going to be a long day!

cd ~ means "change the directory I'm in to my home directory". Either you, or a script is trying to unsuccesfully run this command. Like Chris said, a grep will save your day:

cd /
grep -r 'cd ~' * -n

^this will switch to your root directory cd /, recursively -r search for the string 'cd ~' in all files *, and also give the line number -n

maybe grep for files containing the string cd whos last access time was recent