LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 809|回复: 8

请问如何让rxvt用粗体显示目录名?

[复制链接]
发表于 2007-3-20 12:55:53 | 显示全部楼层 |阅读模式
现在我的rxvt不管是文件还是目录,显示出来都是一样的,很难区分,请问有什么办法能让rxvt用粗体或者是用另外一种颜色显示目录?还有,如果我想让rxvt用蓝色显示.c文件,用绿色显示.lisp文件等等,这个能做到么?要怎么设置?
发表于 2007-3-20 13:13:09 | 显示全部楼层
echo $LS_COLORS
然后看看里面哪个你不满意吧。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-3-20 15:22:12 | 显示全部楼层
貌似我没有设置这个变量……
能贴下你的LS_COLORS变量么?我看看格式怎么写……
回复 支持 反对

使用道具 举报

发表于 2007-3-20 17:17:25 | 显示全部楼层
这个是系统的变量,不要自己设,文件在/etc/目录下面,自己去看一下就是了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-3-21 14:07:38 | 显示全部楼层
不懂……具体位置在哪儿啊?
回复 支持 反对

使用道具 举报

发表于 2007-3-21 18:54:04 | 显示全部楼层
我有,呵呵

  1. 0[root@9JimmyLu2 jimmy]# echo $LS_COLORS
  2. no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
  3. 0[root@9JimmyLu2 jimmy]#
复制代码


不过我看不懂.呵呵 有兄弟可以简单解释一下吗?
先谢过.
回复 支持 反对

使用道具 举报

发表于 2007-3-21 18:59:50 | 显示全部楼层
dircolors:  Color setup for ls

dircolors outputs a sequence of shell commands to set up the terminal for color output from ls (and dir, etc.). Typical usage:

  eval `dircolors [option]... [file]`




If file is specified, dircolors reads it to determine which colors to use for which file types and extensions. Otherwise, a precompiled database is used. For details on the format of these files, run `dircolors --print-database'.

下面是我系统的 dircolors --print-database 的输出. 里面已经讲解得很清楚了. 呵呵


  1. # Configuration file for dircolors, a utility to help you set the
  2. # LS_COLORS environment variable used by GNU ls with the --color option.

  3. # The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
  4. # slackware version of dircolors) are recognized but ignored.

  5. # Below, there should be one TERM entry for each termtype that is colorizable
  6. TERM linux
  7. TERM linux-c
  8. TERM mach-color
  9. TERM console
  10. TERM con132x25
  11. TERM con132x30
  12. TERM con132x43
  13. TERM con132x60
  14. TERM con80x25
  15. TERM con80x28
  16. TERM con80x30
  17. TERM con80x43
  18. TERM con80x50
  19. TERM con80x60
  20. TERM dtterm
  21. TERM xterm
  22. TERM xterm-color
  23. TERM xterm-debian
  24. TERM rxvt
  25. TERM screen
  26. TERM screen-w
  27. TERM vt100
  28. TERM Eterm

  29. # Below are the color init strings for the basic file types. A color init
  30. # string consists of one or more of the following numeric codes:
  31. # Attribute codes:
  32. # 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
  33. # Text color codes:
  34. # 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
  35. # Background color codes:
  36. # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
  37. NORMAL 00        # global default, although everything should be something.
  38. FILE 00                # normal file
  39. DIR 01;34        # directory
  40. LINK 01;36        # symbolic link.  (If you set this to 'target' instead of a
  41.                 # numerical value, the color is as for the file pointed to.)
  42. FIFO 40;33        # pipe
  43. SOCK 01;35        # socket
  44. DOOR 01;35        # door
  45. BLK 40;33;01        # block device driver
  46. CHR 40;33;01        # character device driver
  47. ORPHAN 40;31;01 # symlink to nonexistent file

  48. # This is for files with execute permission:
  49. EXEC 01;32

  50. # List any file extensions like '.gz' or '.tar' that you would like ls
  51. # to colorize below. Put the extension, a space, and the color init string.
  52. # (and any comments you want to add after a '#')

  53. # If you use DOS-style suffixes, you may want to uncomment the following:
  54. #.cmd 01;32 # executables (bright green)
  55. #.exe 01;32
  56. #.com 01;32
  57. #.btm 01;32
  58. #.bat 01;32

  59. .tar 01;31 # archives or compressed (bright red)
  60. .tgz 01;31
  61. .arj 01;31
  62. .taz 01;31
  63. .lzh 01;31
  64. .zip 01;31
  65. .z   01;31
  66. .Z   01;31
  67. .gz  01;31
  68. .bz2 01;31
  69. .deb 01;31
  70. .rpm 01;31
  71. .jar 01;31

  72. # image formats
  73. .jpg 01;35
  74. .jpeg 01;35
  75. .gif 01;35
  76. .bmp 01;35
  77. .pbm 01;35
  78. .pgm 01;35
  79. .ppm 01;35
  80. .tga 01;35
  81. .xbm 01;35
  82. .xpm 01;35
  83. .tif 01;35
  84. .tiff 01;35
  85. .png 01;35
  86. .mov 01;35
  87. .mpg 01;35
  88. .mpeg 01;35
  89. .avi 01;35
  90. .fli 01;35
  91. .gl 01;35
  92. .dl 01;35
  93. .xcf 01;35
  94. .xwd 01;35

  95. # audio formats
  96. .ogg 01;35
  97. .mp3 01;35
  98. .wav 01;35
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-3-24 20:30:41 | 显示全部楼层
好像并不起作用……
我运行dircolors,然后echo $LS_COLORS还是显示没有定义
我手动export LS_COLORS这个变量,不过貌似没有效果……
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-3-24 20:34:04 | 显示全部楼层
汗……我忘了用ls --color了……
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表