Linux CLI through Putty, do colors signify anything?
When I connect to a RHEL CLI via Putty, some folders are blue, some are highlighted green, etc etc.
Does all that signify something? Is there a link to a site that tells me what it all means? |
usually, blue are dirs, green are executables, red are archives, ltblue are symlinks, yellow are devices, etc, etc. basically it depends on color setup on linux box.
|
You mean that you login via Putty and enter e.g. ls to view the contents of the current directory?
ls can view different file types with different colors. (look at the LS_COLORS environment variable to get the meaning of them, since you can configure them as you want). Enter "echo $LS_COLORS" and entries like "*.gz=0;31" tell you that file names ending with .gz should be viewed green with black background. |
ok, thanks. Looks like some of my directories are blue, some are blue text but highlighted green for some reason.
|
Quote:
here's what my echo shows me, but how do I know what the numbers signify? like what color is what number, and is the first number background and the second text color? 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;4 1: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:*.b z2=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: |
The values are "Select Graphics Rendition" numbers. You can find their meaning at
http://en.wikipedia.org/wiki/ANSI_escape_code search for SGR. Example: *.sh=00;32 means files matching *.sh will select the following attributes: reset all then select green as the foreground color e.g.: view png-files as yellow on blue background underlined: *.png=00;04;44;33 special names: no - nothing fi - file di - directory ln - symbolic link pi - pipe so - socket do - ? bd - block device cd - character device or - invalid file su - setuid file sg - setgid file tw - sticky (writable) ow - writeable by others (directory) st - sticky (not writable) ex - executable |
Cool, thanks for all the info, i'll check it out!
|
I looked, but I still dont understand why some of my directories are just blue text, but some are blue text and highlighted green. does it have something to do with the permissions on the folder? like if its 770 its just blue text, if 777 blue text with green highlight?
|
Indeed the color has something to do with the permissions. If a directory has permission 777 it is writable by everybody. Thus it falls into category ow. Thus the rules
ow and di are applied. |
Oh ok. I didn't see an ow in my echo output, so that must just be a default thing. I think I get it now!
|
All times are GMT -5. The time now is 10:34 PM. |