zoukankan      html  css  js  c++  java
  • 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.

  • 相关阅读:
    Python 简单入门指北(一)
    React Native 从入门到原理一
    WWDC 17: 开发者的最初观感
    写给程序员的管理入门课程 -《格鲁夫给经理人的第一课》
    RxSwift之路 1#Swift语法知识准备
    猿题库从 Objective-C 到 Swift 的迁移
    谈一谈iOS事件的产生和传递
    李洪强原创博客01
    re.S、 re.M
    1111111
  • 原文地址:https://www.cnblogs.com/cheese-bacon/p/4108675.html
Copyright © 2011-2022 走看看