Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to track down a vague error in apache logs

Tags:

php

apache2

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!

like image 808
user1410788 Avatar asked May 22 '12 17:05

user1410788


1 Answers

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

like image 172
JoeCortopassi Avatar answered Oct 21 '22 03:10

JoeCortopassi