在linux shell中不显示路径了,显示为-bash-4.1#用起来很不方便。
如何改为显示路径的shell呢?
步骤如下:
vim ~/.bash_profile
(不用管.bash_profile这个文件有几个,自己新建一个也是可以的)
在最后加上
export PS1='[\u@\h \W]\$'
然后执行
source ~/.bash_profile
这样shell就可以显示路径了。
本文介绍如何在 Linux 的 Bash shell 中配置 PS1 环境变量以显示当前工作目录的路径,通过编辑 ~/.bash_profile 文件并添加 exportPS1='[u@hW]$' 实现这一目标。
在linux shell中不显示路径了,显示为-bash-4.1#用起来很不方便。
如何改为显示路径的shell呢?
步骤如下:
vim ~/.bash_profile
(不用管.bash_profile这个文件有几个,自己新建一个也是可以的)
在最后加上
export PS1='[\u@\h \W]\$'
然后执行
source ~/.bash_profile
这样shell就可以显示路径了。
33万+

被折叠的 条评论
为什么被折叠?