All the directories and files will be displayed in white on the server you are logged in to.
I first copied /etc/DIR_COLORS to my home directory as .dir_colors.
Some of the contents of ~/.dir_colors are as follows.
#Below are the color init strings for the basic file types.A color init
# US>string registers of one or more of the following numeric codes:
# Attribute codes:
# 00=none01=bold04=undercore05=blink07=reverse08=concealed
# Text color codes:
# 30=black31=red32=green33=yellow34=blue35=magenta36=cyan37=white
# Background color codes:
# 40=black41=red42=green43=yellow44=blue45=magenta46=cyan47=white
NORMAL00#global default, through everything should be something.
FILE00#normal file
DIR01;34# directory
LINK 01;36#symbolic link
FIFO 40;33#pipe
SOCK01;35#socket
BLK 40;33;01 #block device driver
CHR40;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
I added eval`dircolors.dir_colors-b`
to ~/.bashrc and ran source.bashrc
, but both files and directories remained white.
echo$LS_COLORS
also shows nothing.
What is the cause?
The variable echo$TERM
was not listed in DIR_COLORS
. I added TERM
to the copied .dir_colors
and it was resolved successfully.
By the way, it was also resolved by alias ls='ls --color'
.
--Questioner's Comments.The idea is metropolis's Origin from this comment.
eval`dircolors.dir_colors-b`
instead of
eval`dircolors~/.dir_colors-b`
I think it is necessary to(~/
is missing)
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.