linux - 增加bash 并且显示前面的host

访问量: 852

refer to:https://superuser.com/questions/601181/how-to-display-current-path-in-command-prompt-in-linuxs-sh-not-bash

很多docker都是对内容各种精简。

导致登录之后只有sh ,没有bash

解决办法:

1. 安装bash   (  alpine:   apk add bash)

2. 修改 vim ~/.bashrc
add following lines:

# notice the tailing space
export PS1='$(whoami)@$(hostname):$(pwd)# '

3. open a new termal and you will find :

root@6e5efa720515:/opt/myapp#

订阅/RSS Feed

Subscribe