shell命令行只显示-bash-4.1 不显示用户和路径解决方法

今天一不小心打了home目录删除命令,虽然最后因为种种原因没有删掉,但是home目录下很多文件和目录都被删了,而且命令行也不显示当前用户和路径了

下面对其重新设置,需要设置两个文件:~/.bashrc和~/.bash_profile 

1. bashrc 在当前目录下新建.bashrc文件,内容如下:

# .bashrc 
# Source global definitions 
if [ -f /etc/bashrc ]; then 
	. /etc/bashrc 
fi
# User specific aliases and

2. 在当前目录下新建.bash_profile文件,内容如下:

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

3. source上面两个文件,使得其生效


你可能感兴趣的:(shell)