[请教][ubuntu]缩短命令提示前缀

27 views
Skip to first unread message

adream

unread,
May 13, 2012, 3:12:50 AM5/13/12
to shlug
举例说明:
当我深入到某一目录时,比如进入 Ubuntu One/work 目录,此时命令提示行的前最变成 abc@abc-VirtualBox:~/Ubuntu One/work
我希望命令提示行的前缀始终保持为 abc@abc-VirtualBox
谢谢

AleiPhoenix (A.K.A Areverie)

unread,
May 13, 2012, 3:35:40 AM5/13/12
to sh...@googlegroups.com
echo $PS1

设置PS1就行了。

比如不想要路径的话,把\w去掉。(\W是当前文件夹名,\w是完整路径)

profile里处理比较多

在自己.bashrc里写一个PS1

举例:

export PS1="\u@\h \$"

2012/5/13 adream <adre...@gmail.com>



--
Silence is gold.

twitter: @areverie
wikipedia: AleiPhoenix
blog: weblog.areverie.org
wiki: wiki.areverie.org


adream

unread,
May 13, 2012, 4:42:11 AM5/13/12
to sh...@googlegroups.com
谢谢
Reply all
Reply to author
Forward
0 new messages