Ubuntu去掉命令行前用户名和主机名方法

Ubuntu去掉命令行前用户名和主机名方法

$ vi ~/.bashrc

按a或i进入编辑模式

PS1='${debian_chroot:+(debian_chroot)}\w\$ '

默认为

PS1='${debian_chroot:+(debian_chroot)}\u@\h:\w\$ '

注:u为username,h为hostname

按Esc键退出编辑模式

:wq (保存并退出)

$ source ~/.bashrc