bash: history: : cannot create: No such file or directory 问题处理!

做~自己de王妃 提交于 2020-03-15 23:46:23

问题如图

root@VM_0_13_centos /]# /etc/init.d/metasploit stop
worker is stopped
Exiting!
metasploit is stopped
prosvc is stopped
nginx is stopped
/opt/metasploit/postgresql/scripts/ctl.sh : postgresql stopped
bash: history: : cannot create: No such file or directory
[root@VM_0_13_centos /]# cd /root/
bash: history: : cannot create: No such file or directory
[root@VM_0_13_centos root]# ls
bash: history: : cannot create: No such file or directory

无论我在命令行输入什么命令都会提示

bash: history: : cannot create: No such file or directory

问题解决

[root@VM_0_13_centos ~]# echo $HISTROTY

bash: history: : cannot create: No such file or directory

设置变量

[root@VM_0_13_centos ~]# cat .bash_profile   #打开
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin
HOME=/root
HISTFILE=/root/.bash_history  #添加
export PATH

[root@VM_0_13_centos ~]# source .bash_profile   #生效



#一切正常
[root@VM_0_13_centos ~]# ls  
[root@VM_0_13_centos ~]# cat .bash_profile 

 

 

 

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!