修改后的效果:

操作步骤:

情况①:如果是Ubuntu或者Debian,按照下面的流程,两步解决:

  1. 打开~/.bashrc
  2. 修改参数force_color_prompt=yes去掉前面的注释#

情况②:如果是CentOS中,按照下面的流程,两步解决:

  1. 打开~/.bashrc
  2. 在文件末尾添加如下内容:
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color|*-256color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes 

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    # We have color support; assume it's compliant with Ecma-48
    # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
    # a case would tend to support setf rather than setaf.)
    color_prompt=yes
    else
    color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

Xshell设置主机名高亮的更多相关文章

  1. centos7的网络配置以及设置主机名和绑定IP的问题

    CentOS 7.0系统是一个很新的版本哦,很多朋友都不知道CentOS 7.0系统是怎么去安装配置的哦,因为centos7.0与以前版本是有很大的改进哦. 说明:截止目前CentOS 7.x最新版本 ...

  2. linux查看与设置主机名

    1.设置主机名    通过编辑/etc/sysconfig/network文件中的HOSTNAME字段就可以修改主机名.如下所示:     [root@zijuan /]# vim /etc/sysc ...

  3. 用户管理_组管理_设置主机名_UGO_文件高级权限_ACL权限

    用户管理: 添加用户:useradd tom 设置密码:passwd tom 切换账户: su - tom (不加-也能切换,但是 -会有两点不同 1.有-会切换到该用户的主目录  2.会切换到该用户 ...

  4. 【Centos7】hostnamectl 设置主机名

    Centos7中提供了设置主机名的工具 hostnamectl hostname有三种状态 static(永久) transient(瞬态) pretty (灵活) 查看主机名状态 [oracle@h ...

  5. Centos7】hostnamectl 设置主机名

    Centos7中提供了设置主机名的工具 hostnamectl hostname有三种状态 static(永久) transient(瞬态) pretty (灵活) 查看主机名状态 [oracle@h ...

  6. CentOS7 设置主机名及IP映射

    1.设置主机名 查看本机的主机名,使用如下三个命令中任意一个即可 # hostname # uname -n # cat /proc/sys/kernel/hostname 使用 vi 编辑器打开 / ...

  7. Linux命令之hostname - 显示或设置主机名

    我使用过的Linux命令之hostname - 显示或设置主机名 本文链接:http://codingstandards.iteye.com/blog/804648   (转载请注明出处) 用途说明 ...

  8. 利用iis创建网站后为什么不能设置主机名

    主机名 主机名就是网站的域名,通俗说就是网站地址(如:www.baidu.com). 设置了主机名,而IIS确不知道主机名对应的地址在哪里. 举个例子,把www.baidu.com做为IIS网站的主机 ...

  9. linux 查看和设置主机名

    1.设置主机名 通过编辑/etc/sysconfig/network文件中的HOSTNAME字段就可以修改主机名.如下所示: [root@zijuan /]# vim /etc/sysconfig/n ...

随机推荐

  1. Entity Framework Tutorial Basics(32):Enum Support

    Enum in Entity Framework: You can now have an Enum in Entity Framework 5.0 onwards. EF 5 should targ ...

  2. SDUT 2498 AOE网上的关键路径

    AOE网上的关键路径 Time Limit: 1000MS Memory Limit: 65536KB Submit Statistic Problem Description 一个无环的有向图称为无 ...

  3. 使用IDEA开发SPARK提交remote cluster执行

    开发环境 操作系统:windows 开发工具:IntelliJ IDEA  14.1.1 需要安装scala插件 编译环境:jdk 1.7   scala 2.10.4 使用IDEA开发spark应用 ...

  4. 11.PowerSploit攻击指南

    本人小白,写这篇文章主要记录一下自己的PowerShell学习之路,大牛请绕道:https://www.anquanke.com/subject/id/90541 首先PowerShell的攻击工具有 ...

  5. 跑实验配环境(tensorflow)

    最近在学习用CNN(卷积神经网络)做图像质量评价,选择的论文是CVPR2014-Convolutional neural networks for no-reference image quality ...

  6. 接口型模式(二)Bridge(桥接)模式

    目的: 将抽象与抽象方法的实现相分离,使得它们可以独自变化.常用于驱动程序中,使得顶层逻辑不受驱动底层改变的影响,如数据库的变化. 关键词:Bridge, 抽象与实现分离,驱动程序 必要性:从一般抽象 ...

  7. 线程池ThreadPool实现异步多线程

    ThreadPool线程池的主要方法: 1. public static Boolean QueueUserWorkItem(WaitCallback wc, Object state); WaitC ...

  8. Vim编辑器的学习

    在老师的带领下,最近也算是涨了见识.自己安装并尝试着体验了Vim的一些基本功能,可能是作为初学者,总感觉其指令太过复杂,就文本编辑而言,给我的最大感受就是神而乎之,一头雾水.目前我对这款编译器的掌握水 ...

  9. 转载Json和Xml的区别,以及它们的底层是如何处理的

    XML:可扩展标记语言       JSON:轻量级的数据交换格式 区别: 1.可读性方面:基本相同,Xml的可读性较好些: 2.可扩展性方面:都有较好的扩展性: 3.编码难度方面:json的编码较容 ...

  10. WebForm与MVC混用 (转)

    http://blog.csdn.net/leftfist/article/details/11591231