试图跟踪apache日志中的一个模糊错误

时间:2022-10-06 08:03:18

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.

我正在尝试在新的Ubuntu服务器上清除错误,并在日志中发现错误,我不知道如何跟踪错误。

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!

提前谢谢。这将是漫长的一天!

2 个解决方案

#1


6  

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可以拯救你的一天:

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

^这将cd /切换到根目录,递归地- r搜索字符串“cd ~”所有文件*,也给- n的行号

#2


0  

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

可能包含字符串cd whos的文件的grep上次访问时间是最近的

#1


6  

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可以拯救你的一天:

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

^这将cd /切换到根目录,递归地- r搜索字符串“cd ~”所有文件*,也给- n的行号

#2


0  

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

可能包含字符串cd whos的文件的grep上次访问时间是最近的