问题如图
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
来源:oschina
链接:https://my.oschina.net/kcw/blog/3195505