更改shell提示行
2012-10-16 18:57
148 查看
更改shell提示行
Table of Contents
1 通过$PS1更改2 通过~/.bashrc更改
1 通过$PS1更改
$PS1表示bsah提示符,通常情况下都是PS1='${debianchroot:+($debianchroot)}\u@\h:\w\$ '。其中\u表示目前的用户名,\h表示当前主机名,\w表示当前目录,\$表示如果非root则显示$,root显示#。
在终端输入export $PS1='…'就可实现更改shell提示符。但是这种更改在下次重新启动的时候就会恢复。
2 通过~/.bashrc更改
在~/.bashrc中有这么一段,将其中的东西更改为你需要的即可,可长久保存。if [ "$color_prompt" = yes ]; then # 将原提示符更改目前的提示符,如果不合适可将注释行去掉。 # PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else # # PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' PS1='${debian_chroot:+($debian_chroot)}\w\$ ' fi
Author: lishuo
Org version 7.9.1 with
Emacs version 23
Validate XHTML 1.0
相关文章推荐
- shell终端中更改提示符颜色
- 更改shell 的提示显示方式
- 控制台提示: ADB rejected shell command (ls -l ): closed
- 输入adb shell 时 提示error: more than one device and emulator
- mysql更改数据库目录提示“ERROR 2002 (HY000): '/var/lib/mysql/mysql.sock' (2)”
- Exchange2003的OWA客户端IE无法更改密码,提示缺少对象的建议解决方案
- Win10更改搜索框提示文字的方法!win10修改 搜索Web 和Windows文字的方法!
- 更改触摸屏校准程序界面提示文字
- 关于adb shell 提示 device not found 的处理
- MFC更改控件ID后,编译器会提示“未定义的标识符”
- adb shell ,出错 提示error: device not found
- 关于误更改/var下诺干的权限问题,导致系统启动提示The System is running in low-graphics mode问题解决 By ACReaper
- Mac: Mac系统从移动硬盘往外考资料时提示“不能更改xx中的一个或多个项目,因为它们正在使用中”压根就没开始用
- Shell 批量更改主机名
- SHELL syntax error:unexpected end of file 提示错误
- SHELL syntax error:unexpected end of file 提示错误; windows下修改linux文件导致linux文件无法使用
- sql server 中对表更改时无法保存修改,提示”无法保存要求重新创建表的更改“的解决方法
- Mac 终端命令行提示符更改方法
- 马克下自己的bash下给shell提示上色的设置
- adb shell提示error: could not install *smartsocket* listener