用 dircolors -p  可以 看到缺省的颜色设置,包括各种颜色和“粗体”,下划线,闪烁等定义。

而变量 $LS_COLORS  是设置颜色的变量;

如我的设置如下:

export LS_COLORS="no=00:fi=00:di=00;35: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:"

另:

/etc/DIR_COLORS 文件为系统默认颜色参数配置文件

如果想修改定义自己的颜色参数配置文件,请执行如下操作:

1. cp /etc/DIR_COLORS $HOME/.dir_colors

2. 修改中的颜色定义 $HOME/.dir_colors

我的配置如下:

# Configuration file for the color ls utility

# This file goes in the /etc directory, and must be world readable.

# You can copy this file to .dir_colors in your $HOME directory to override

# the system defaults.

# COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not

# pipes. 'all' adds color characters to all output. 'none' shuts colorization

# off.

COLOR tty

# Extra command line options for ls go here.

# Basically these ones are:

# -F = show '/' for dirs, '*' for executables, etc.

# -T 0 = don't trust tab spacing when formatting ls output.

OPTIONS -F -T 0

# Below, there should be one TERM entry for each termtype that is colorizable

TERM linux

TERM console

TERM con132x25

TERM con132x30

TERM con132x43

TERM con132x60

TERM con80x25

TERM con80x28

TERM con80x30

TERM con80x43

TERM con80x50

TERM con80x60

TERM cons25

TERM xterm

TERM rxvt

TERM xterm-color

TERM color-xterm

TERM vt100

TERM dtterm

TERM color_xterm

TERM ansi

TERM screen

TERM screen.linux

TERM kon

TERM kterm

TERM gnome

TERM konsole

# EIGHTBIT, followed by '1' for on, '0' for off. (8-bit output)

EIGHTBIT 1

# Below are the color init strings for the basic file types. A color init

# string consists of one or more of the following numeric codes:

# Attribute codes:

# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed

# Text color codes:

# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white

# Background color codes:

# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white

NORMAL 00# global default, although everything should be something.

FILE 00 # normal file

DIR 01;35 # directory

LINK 01;36 # symbolic link

FIFO 40;33# pipe

SOCK 01;35# socket

BLK 40;33;01# block device driver

CHR 40;33;01 # character device driver

ORPHAN 01;05;37;41 # orphaned syminks

MISSING 01;05;37;41 # ... and the files they point to

# This is for files with execute permission:

EXEC 01;32

# List any file extensions like '.gz' or '.tar' that you would like ls

# to colorize below. Put the extension, a space, and the color init string.

# (and any comments you want to add after a '#')

.cmd 01;32 # executables (bright green)

.exe 01;32

.com 01;32

.btm 01;32

.bat 01;32

.sh 01;32

.csh 01;32

.tar 01;31 # archives or compressed (bright red)

.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 # image formats

.gif 01;35

.bmp 01;35

.xbm 01;35

.xpm 01;35

.png 01;35

.tif 01;35

linux中目录文件用ls显示是绿色的,linux 下设置 ls 命令 显示 文件、文件夹颜色...相关推荐

  1. linux 常见路径,linux中目录与路径常见相关命令

    linux中目录与路径常用命令 相对路径与绝对路径 绝对路径:路径的学法一定由根目录/写起.如/user/share/doc. 相对路径:目录不由/写起.如/user/share/doc要切换到/us ...

  2. linux中的绝对路径 lt gt,Linux中目录以及路径问题

    具体参考:https://www.cnblogs.com/OctoptusLian/p/8546580.html 在Linux中,存在着绝对路径和相对路径 绝对路径:路径的写法一定是由根目录 / 写起 ...

  3. linux设置历史命令行数,Linux设置history命令显示行数以及时间

    Linux和unix上都提供了history命令,可以查询以前执行的命令历史记录 但是,这个记录并不包含时间项目 因此只能看到命令,但是不知道什么时间执行的 如何让history记录时间呢? 解决方案 ...

  4. Linux命令删除find,浅谈Linux下通过find命令进行rm文件删除的小技巧

    我们经常会通过find命令进行批量操作,如:批量删除旧文件.批量修改.基于时间的文件统计.基于文件大小的文件统计等,在这些操作当中,由于rm删除操作会导致目录结构变化,如果要通过find结合rm的操作 ...

  5. linux 修改文件内容sed,linux下通过sed命令直接修改文件内容

    linux下通过sed命令直接修改文件内容 sed是实现对流的编辑.通常,我们使用sed可以实现内容的编辑后然后保存成另外的一个文件,如果正确的话,才写入到源文件.但是某些时候,我们需要直接修改文件, ...

  6. 中文linux(Ubuntu)下让date命令显示英语日期

    Question 操作系统为中文,所以date显示都是中文.但是又无法更改操作系统的语言,因为还是要使用中文系统的. Solution localhost:dist Sean$ date 2018年 ...

  7. 命令行下使用javah命令生成.h文件,出现“错误: 无法访问android.app.Activity 找不到android.app.Activity的类文件”的解决方法...

    在学习NDK中,当我在项目的bin/classes目录下使用javah命令生成头文件时,出现了"错误: 无法访问android.app.Activity 找不到android.app.Act ...

  8. cmd xcopy 拷贝文件夹_在纯dos下用xcopy命令怎么复制文件夹

    在纯 dos 下用 xcopy 命令怎么复制文件夹 XCOPY --目录复制命令 1 .功能:复制指定的目录和目录下的所有文件连同目录结构. 2 .类型:外部命令 3 .格式: XCOPY [ 源盘: ...

  9. Windows中文件夹与linux中目录的区别

    如果你最开始使用的是 Windows 电脑,你很可能会使用"文件夹folder"这个术语.但当你换到 Linux 时,你会发现文件夹通常被称为"目录directory&q ...

  10. linux中人脸识别不了,虹软人脸识别在 linux中so文件加载不到的问题

    其实是可以加载到的,不过是so文件放的位置不一对,最简单的方式是放在 /usr/lib64 目录下,也可自己设置. so文件加载不到会报这个错误: .lang.UnsatisfiedLinkError ...

最新文章

  1. 使用TinySpider实战抓取自己博客中的内容
  2. (零)我为什么要写Linux学习笔记?
  3. 解决Access denied for user #39;#39;@#39;localhost#39; to database #39;mysql#39;问题
  4. ant-design如果按需加载组件
  5. mysql分组后去重复数据_mysql去掉重复数据只保留一条,以及取分组后的一条数据...
  6. Mysql主备延迟的原因
  7. sqlite3x library
  8. kafka python教程_kafka python 指定分区消费
  9. UIKit应用 - Swift 版本: 3.让UITableViewCell的背景色渐变
  10. 从零开始学前端:形变(小游戏:3D翻滚盒子) --- 今天你学习了吗?(CSS:Day21)
  11. mysql错误代码1怎样解决_打开网页提示mysql发生错误,错误号1194,请问下该怎么解决? 爱问知识人...
  12. XtraBackup备份mysql5.1.73
  13. 项目管理——N个模板
  14. ubuntu查看隐藏文件及显示隐藏文件所占用存储空间
  15. xbox one s驱动_【硬件资讯】次世代主机间最大差距?PS5 120Hz支持成难题,XBOX优势巨大!!...
  16. PyTorch笔记【1】---A卡安装(RX580)无果后,改为N卡(2070)安装。这年头就不要用CPU了来搞AI了
  17. 怎样让一个正常人理解“线性代数”。几乎花掉我全部百度金币下来的文章。
  18. PTA:7-4 解密英文藏头诗 (15分)
  19. EDI在物流行业中的应用
  20. 网络安全-Cisco Packet Tracer Student软件

热门文章

  1. oracle metalink网址,oracle metalink账号|Oracle Metalink账号注册指南-创客空间
  2. 榆林市科技馆项目的变电所运维
  3. [01]GRE|Verbal|Quantitative
  4. animators vs animations
  5. Android BindService 简单使用
  6. 大陆毫米波雷达ARS408-21xx(内附毫米波雷达使用说明书)使用记录:第一期
  7. 电子工程师必备硬件知识
  8. 22协方差矩阵 matlab,协方差协方差矩阵【matlab实例】
  9. iOS开发- 生成/解析.vcf文件
  10. CentOS 7安装Mysql8.0