Ubuntu去掉命令行前用户名和主机名方法
$ vi ~/.bashrc +59
按a或i进入编辑模式
PS1='${debian_chroot:+(debian_chroot)}\w\$ '
默认为
PS1='${debian_chroot:+(debian_chroot)}u@h:\w\$ '
注:u为username,h为hostname
按Esc键退出编辑模式
:wq (保存并退出)
$ source ~/.bashrc
转载于:https://blog.51cto.com/yangzhiming/1360535