Ubuntu修改命令行提示符 (linux - customize prompt in shell)

Ubuntu中如果要把提示符改为当前路径的最后一个目录再加一个空格,可以在~/.bashrc里加入 export PS1='\W> '。(如果在/etc/rc.local/加,~/.bashrc中默认对PS1的设置会覆盖/etc/rc.local中的自定义设置。)

提示符的其它选项、参数可以参见

http://www.linux521.com/2009/system/201103/13326.html

设置方法相同,在~/.bashrc中将PS1设置为相应参数即可。

猜你喜欢

转载自blog.csdn.net/updog/article/details/6611332