LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 04-12-2010, 12:54 PM   #1
jone kim
Member
 
Registered: Apr 2010
Posts: 174

Rep: Reputation: 16
Exclamation color codes in linux


Can anyone answer me the color code of the linux file system?

Especially, for those which have different colors in the background also like some have green background colors and are written in green some have yellow background and are written in black,why is it so?
Also please explain me the color code of other also.
 
Old 04-12-2010, 01:22 PM   #2
Vrajgh
Member
 
Registered: Aug 2005
Posts: 65

Rep: Reputation: 31
I think you are refering to the colours you see when you type "ls." They are there to make it easier to interpret the output. They are fully customizable but I found a thread which suggests some defaults (at least on ubuntu...)

http://ubuntuforums.org/showthread.php?t=501914

I hope it helps!
 
Old 04-13-2010, 01:26 AM   #3
tommyttt
Member
 
Registered: Oct 2009
Location: Federal Way, WA
Distribution: openSUSE 11.4 x86_64, openSuSE 12.1, Fedora 15
Posts: 207

Rep: Reputation: 34
Quote:
Originally Posted by jone kim View Post
Can anyone answer me the color code of the linux file system?

Especially, for those which have different colors in the background also like some have green background colors and are written in green some have yellow background and are written in black,why is it so?
Also please explain me the color code of other also.
If you mean how the colors are defined in a terminal, that would be through ANSI escape sequences as below:
Code:
# ANSI color escape sequences

# local NONE="\[\e[0m\]"

# normal colors
# local K="\[\e[0;30m\]"	# dark black
# local R="\[\e[0;31m\]"	# dark red
# local G="\[\e[0;32m\]"	# dark green
# local Y='\[\e[0;33m\]"	# dark yellow (brown)
# local B="\[\e[0;34m\]"	# dark blue
# local M="\[\e[0;35m\]"	# dark magenta
# local C="\[\e[0;36m\]"	# dark cyan
# local W="\[\e[0;37m\]"	# dark white (L.gray)

# bright (emphasized) colors
# local EK="\[\e[1;30m\]"		# bright black (D.gray)
# local ER="\[\e[1;31m\]"		# bright red
# local EG="\[\e[1;32m\]"		# bright green
# local EY='\[\e[1;33m\]"		# bright yellow
# local EB="\[\e[1;34m\]"		# bright blue
# local EM="\[\e[1;35m\]"		# bright magenta
# local EC="\[\e[1;36m\]"		# bright cyan
# local EW="\[\e[1;37m\]"		# bright white

# background colors
# local BK="\[\e[40m\]"	# black
# local BR="\[\e[41m\]"	# red
# local BG="\[\e[42m\]	# green
# local BY="\[\e[43m\]"	# yellow (brown)
# local BB="\[\e[44m\]"	# blue
# local BM="\[\e[45m\]"	# magenta
# local BC="\[\e[46m\]"	#cyan
# local BW="\[\e[47m\]"	# white (L.gray)

### put color selection and exports here
export	USER_FORE_COLOR="\[\e[0;36m\]"	# color for user Tom = dark cyan
export	USER_BACK_COLOR="\[\e[0m\]"	# no background color
Also see /etc/DIR_COLORS which controls what colors are used in commands such as ls.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ls color codes jpstunr Linux - Newbie 3 03-20-2012 02:41 PM
Using general command color codes in terminal and binding them to ls features Cyberman Programming 7 09-04-2009 09:13 PM
Escape Codes for Console Color trainpic Linux - General 1 03-13-2006 07:45 PM
Shell Color Codes justmoon Linux - General 18 03-16-2003 01:22 PM


All times are GMT -5. The time now is 04:42 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration