Linux Color
来源:互联网 发布:软件质量品质管理 编辑:程序博客网 时间:2024/04/29 16:08
http://www.cnblogs.com/zackyang/archive/2010/03/23/1692830.html
1、将下面的代码拷贝到~/.bash_login中,可以让man有颜色
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
## 指定less为默认阅读器
export PAGER=less
2、让ls有颜色显示,可以在~/.bash_profile中加入:
alias ls=’/bin/ls --color=auto’ ## 如果ls已经是有彩色输出了, 可忽略
3、让grep可以高亮选择的关键字,可以在~/.bash_profile中加入:
alias grep='grep --color' ## 这个是强烈推荐的, 用过多后肯定会喜欢
4、解释一下各个配置文件的读取顺序:
当一个login bash 启动后, (如ssh 登录成功后, 或 bash –login 运行时), login bash将会按以下逻辑去读取配置文件
[[ -r /etc/profile ]] && source /etc/profile
if [[ -r ~/.bash_profile ]]; then
source ~/.bash_profile
elif [[ -r ~/.bash_login ]]; then
source ~/.bash_login
elif [[ -r ~/.profile ]]; then
source ~/.profile
fi
当一个非login 且是interactive的 bash启动时, (如执行bash并回车) ## 如果对login bash, interactive bash的概念不清, 可找俺详谈, 或man bash Bash将按以下逻辑去读取个人配置
[[ -r ~/.bashrc ]] && source ~/.bashrc
值得注意的是, 一个login bash并不会去执行 [[ -r ~/.bashrc ]] && source ~/.bashrc
1、将下面的代码拷贝到~/.bash_login中,可以让man有颜色
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
## 指定less为默认阅读器
export PAGER=less
2、让ls有颜色显示,可以在~/.bash_profile中加入:
alias ls=’/bin/ls --color=auto’ ## 如果ls已经是有彩色输出了, 可忽略
3、让grep可以高亮选择的关键字,可以在~/.bash_profile中加入:
alias grep='grep --color' ## 这个是强烈推荐的, 用过多后肯定会喜欢
4、解释一下各个配置文件的读取顺序:
当一个login bash 启动后, (如ssh 登录成功后, 或 bash –login 运行时), login bash将会按以下逻辑去读取配置文件
[[ -r /etc/profile ]] && source /etc/profile
if [[ -r ~/.bash_profile ]]; then
source ~/.bash_profile
elif [[ -r ~/.bash_login ]]; then
source ~/.bash_login
elif [[ -r ~/.profile ]]; then
source ~/.profile
fi
当一个非login 且是interactive的 bash启动时, (如执行bash并回车) ## 如果对login bash, interactive bash的概念不清, 可找俺详谈, 或man bash Bash将按以下逻辑去读取个人配置
[[ -r ~/.bashrc ]] && source ~/.bashrc
值得注意的是, 一个login bash并不会去执行 [[ -r ~/.bashrc ]] && source ~/.bashrc
0 0
- Linux Color
- Linux Terminal Color
- linux printf color颜色 \033[
- linux bash color text console
- color #
- color
- color
- Color
- color
- color
- color
- Color
- Color
- color
- COLOR
- Color
- color
- color
- 计算机网络基础笔记4
- GCC Warning ISO C++11 Does not allow conversion from literal string to char*
- 编译内核2.3.4遇到的问题以及解决方案
- javascript弹出窗口实现动态文件上传
- 苹果所有常用证书,appID,Provisioning Profiles配置说明及制作图文教程(精)
- Linux Color
- [leetcode]Remove Duplicates from Sorted List
- JAVA线程安全
- Android的系统架构解析
- 黑马程序员--IO(File类、Properties、IO中其他的一些常用流、字符编码)
- swift 利用原生请求上传多张图片和多个参数到服务器
- 安卓快捷键
- [LeetCode] Search Insert Position
- 指针进阶(二)