Trying to track an undefined error in apache logs

I am trying to cross out errors on a new Ubuntu server installation and am getting errors in logs that I don’t know how to track.

Logs show this line again and again.

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 to find a source from such an uncertain error? He doesn’t even have the time of onset that most of the errors in the magazines have.

Thanks in advance. It will be a long day!

+6
source share
2 answers

cd ~ means "change the directory in which I am installed to my home directory." Either you or the script is trying to improperly execute this command. As Chris said, grep will save your day:

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

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

+6
source

there may be grep for files containing the string cd , the last time the last access was

0
source

Source: https://habr.com/ru/post/916376/


All Articles