Changing the Color of Linux ls Command 改变Linux的ls命令显示的颜色
Linux command ls basically use the file /etc/DIR_COLORS or /etc/DIR_COLORS.xterm to define the colors used, in terms of different types of terminal windows.
You can change the definitions directly in these files to alter the colors to meet your expectation. However sometimes you do not have the write access to /etc/ thus you can set an environment variable named LS_COLORS to achieve this goal. A tool named dircolors could be used to translate the definitions in /etc/DIR_COLORS to the commands to set the LS_COLORS environment variable. Use dircolors --help to see the synopsis.
For example, I am using csh, thus I would use:
dircolors -c /etc/DIR_COLORS
Then the command gives:
setenv LS_COLORS 'no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:'
Modify this value and write it to .cshrc to take effect after next sourcing of .cshrc.
Read /etc/DIR_COLORS for the definitions of each value.
Changing the Color of Linux ls Command 改变Linux的ls命令显示的颜色的更多相关文章
- Linux:-bash: ***: command not found,系统很多命令都用不了
系统:64位RHEL6 突然之间linux很多命令都用不了,均提示没有此命令. 这应该是系统环境变量出现了问题导致的. 出现这种可能性的原因有很多,大多数是因为,安装了新的软件要配置环境变量,但是没有 ...
- liunx -bash:ls:command not found,执行命令总是报找不到
解决办法: 使用绝对命令vi打开profile /bin/vi /etc/profile 添加: export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/ ...
- 改变input标签中placeholder显示的颜色
::-webkit-input-placeholder { /* WebKit browsers */ color: #A9A9A9; } :-moz-placeholder { /* Mozilla ...
- 在Linux中让echo命令显示带颜色的字
echo显示带颜色,需要使用参数-e 格式如下: echo -e "\033[字背景颜色;文字颜色m字符串\033[0m" 例如: echo -e "\033[41;37 ...
- 15 Basic ‘ls’ Command Examples in Linux
FROM: http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ ls command is one of the most fr ...
- Linux:-bash: ***: command not found
Linux:-bash: ***: command not found,系统很多命令都用不了,均提示没有此命令. 突然之间linux很多命令都用不了,均提示没有此命令. 这应该是系统环境变量出现了问题 ...
- 在Linux中让文本显示带颜色的字。
在linux中让echo命令显示带颜色的字需要使用参数-e 格式:echo -e "\33[字体背景颜色:文字颜色m字符转\033[0m" 注: 1.字体背景颜色和文字颜色之间是英 ...
- 002_让你的linux虚拟终端五彩缤纷(1)——LS颜色设置
- Linux shell command学习笔记(一)
Shell的种类有很多种,例如CSH,Bourne Shell,Korn Shell.在现在的大多数Linux发行版中,默认的Shell一般都是Bourne again shell(bash). &l ...
随机推荐
- eclipse error pages打红X的解决方法
当我在关闭eclipse时,漫长的等待进度条,我情急之下强关了系统.悲催的是再打开eclipse时新建动态web项目时,总是出现error pages打红X问题,程序执行等都不受影响,就是看着不爽.网 ...
- thinkphp 验证
//YongHuModel.class.php namespace Home\Model; use Think\Model; class YongHuModel exstends Model { pr ...
- 枚举全排列(包括数列中有重复数)的C语言实现
据说是用了DFS的思想--然鹅并不知道这是DFS. 主要就是选取一个数放到数组相应位置上,然后递归的排列剩下的数组,将剩下的数组递归排列完了之后再把数放回去,然后这一层递归就返回了-- 有重复数的话遇 ...
- PTA Insert or Merge
According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and gr ...
- fastjson将json字符串转化成bean对象解析出错的检查方法
我的情况是:解析第一层数据成功,解析第二层嵌套的数据失败.如: { "response": { "resultcode": "0", &qu ...
- AngularJs + Web API 页面开发(一)
AngularJS这个JS框架是个神马东东我也不太清楚,我也是初学者~~ AngularJS适用于single page App,单页面程序都是局部刷新的,这一点和Ajax有第一的区别,因为使用Aja ...
- poj 2761 Feed the dogs (treap树)
/************************************************************* 题目: Feed the dogs(poj 2761) 链接: http: ...
- [z]Java开发必会的Linux命令
1.查找文件 find / -name filename.txt 根据名称查找/目录下的filename.txt文件. find . -name "*.xml" 递归查找所有的xm ...
- 用SMIL语言编写一个简单的演示
一.首先需要注意的几点是: 1.用记事本编写代码时,要保存为后缀名为.smil或.smi的文件,并且编码格式选择为UTF-8. 2.打开.smil文件的播放器选择为:RealPlayer或是Ambul ...
- margin 碰到过的重叠问题
双倍margin 稍微记录一下,因为常忘 float + margin,实际边距会变成设置值的双倍. 解决办法是 将元素设为 display:inline 最好要了解 IE的 haslayout 问题 ...