Sponsored Content
Top Forums Shell Programming and Scripting How to use dir_colors to change color of files with executable privileges Post 302489197 by Chubler_XL on Wednesday 19th of January 2011 06:30:13 PM
Old 01-19-2011
dircolors -p > ~/.dircolors exports the default dircolors configuration to a file name .dircolors in your home directory (replacing the file if it already exists).

This is so that you can start with what ls normally does without a LS_COLORS env var.
This User Gave Thanks to Chubler_XL For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Change background color in VI editor

Hi, I am new to unix. How can i change the background color in vi? Thank you. -tictactoe (1 Reply)
Discussion started by: tictactoe
1 Replies

2. Shell Programming and Scripting

Font Color Change Using .profile

Does anyone know how can I change font color, background color etc for a particular user using .profile? Any help is appreciated. (0 Replies)
Discussion started by: fifo_vs_lifo23
0 Replies

3. UNIX for Dummies Questions & Answers

How to change the font or color of text

Hi Gurus, I have a small requirement where i want to change the color & font of some text in a file. i have a file error.txt which will be created in the script using egrep. After that iam adding these lines at head & tail to that file using the following code awk 'BEGIN{print"Please... (4 Replies)
Discussion started by: pssandeep
4 Replies

4. Linux

DIR_COLORS change in fedora

Hi all, I'm using fedora 6 and I did change the colors in /etc/DIR_COLORS file. The changes are effect everywhere except "root" log in If I open it in a gnome terminal. If I go command line for "root" (Alt+F2) the changes are there but not in root using gnome terminal. For all other users, the... (1 Reply)
Discussion started by: lchokka
1 Replies

5. Shell Programming and Scripting

Change file privileges automatically

Hi, Is it possible to write and run a shell script for specific directory( Apache/htdocs) that changes root privilege read/write to chmod 755 when a program uploads a file (word,PPT,XSL,..) to that directory Thanks, Mk (3 Replies)
Discussion started by: mkohan
3 Replies

6. Solaris

How to change folder color in terminal ?

Hi all, I am really new to UNIX ..and can any1 help me on change the yellow color to blur color (folder) ? Please refer to the attached pictures .. Your help is really appreciated .. :) Have a nice day ! (5 Replies)
Discussion started by: sauronlord
5 Replies

7. Debian

Change the privileges needed to run a program

Hi everyone, I have an issue with a project of mine. I have to run a program on a terminal which requires to be logged in as su to have it run it. Given that I'm having problem to use expect to give the password I'd like to change the privilege of that program from SU to normal user ( I have the SU... (13 Replies)
Discussion started by: gaisselick87
13 Replies

8. Shell Programming and Scripting

Change color on another terminal

i already have a running and working script for remote connection. is there a way to change the terminal color everytime I ssh remotely to another server? this is to avoid confusion since I will be using only one server to remotely access around 50 servers (solaris, linux,. etc) (2 Replies)
Discussion started by: lhareigh890
2 Replies

9. UNIX for Dummies Questions & Answers

How to change color when doing echo in tcsh?

Is it possible to change the color when doing an echo? Example, having the following command print in dark blue. echo "Hello" ---------- Post updated at 11:50 AM ---------- Previous update was at 10:25 AM ---------- Just figured out how to do it (2 Replies)
Discussion started by: kristinu
2 Replies

10. UNIX for Dummies Questions & Answers

How to change the background color in the init 3 mode(not line color)

Hello, I am using RHEL 6.1 on VMware I am searching for a way to change background color (not line by line color wich one can using tput command) basically changing the color of the whole screen to white instead of the default black and changing font color to black and alos would like to... (2 Replies)
Discussion started by: Dexobox
2 Replies
DIR_COLORS(5)							 Linux User Manual						     DIR_COLORS(5)

NAME
dir_colors - configuration file for dircolors(1) DESCRIPTION
The program ls(1) uses the environment variable LS_COLORS to determine the colors in which the filenames are to be displayed. This envi- ronment variable is usually set by a command like eval `dircolors some_path/dir_colors` found in a system default shell initialization file, like /etc/profile or /etc/csh.cshrc. (See also dircolors(1).) Usually, the file used here is /etc/DIR_COLORS and can be overridden by a .dir_colors file in one's home directory. This configuration file consists of several statements, one per line. Anything right of a hash mark (#) is treated as a comment, if the hash mark is at the beginning of a line or is preceded by at least one whitespace. Blank lines are ignored. The global section of the file consists of any statement before the first TERM statement. Any statement in the global section of the file is considered valid for all terminal types. Following the global section is one or more terminal-specific sections, preceded by one or more TERM statements which specify the terminal types (as given by the TERM environment variable) the following declarations apply to. It is always possible to override a global declaration by a subsequent terminal-specific one. The following statements are recognized; case is insignificant: TERM terminal-type Starts a terminal-specific section and specifies which terminal it applies to. Multiple TERM statements can be used to create a section which applies for several terminal types. COLOR yes|all|no|none|tty (Slackware only; ignored by GNU dircolors(1).) Specifies that colorization should always be enabled (yes or all), never enabled (no or none), or enabled only if the output is a terminal (tty). The default is no. EIGHTBIT yes|no (Slackware only; ignored by GNU dircolors(1).) Specifies that eight-bit ISO 8859 characters should be enabled by default. For com- patibility reasons, this can also be specified as 1 for yes or 0 for no. The default is no. OPTIONS options (Slackware only; ignored by GNU dircolors(1).) Adds command-line options to the default ls command line. The options can be any valid ls command-line options, and should include the leading minus sign. Note that dircolors does not verify the validity of these options. NORMAL color-sequence Specifies the color used for normal (nonfilename) text. FILE color-sequence Specifies the color used for a regular file. DIR color-sequence Specifies the color used for directories. LINK color-sequence Specifies the color used for a symbolic link. ORPHAN color-sequence Specifies the color used for an orphaned symbolic link (one which points to a nonexistent file). If this is unspecified, ls will use the LINK color instead. MISSING color-sequence Specifies the color used for a missing file (a nonexistent file which nevertheless has a symbolic link pointing to it). If this is unspecified, ls will use the FILE color instead. FIFO color-sequence Specifies the color used for a FIFO (named pipe). SOCK color-sequence Specifies the color used for a socket. DOOR color-sequence (Supported since fileutils 4.1) Specifies the color used for a door (Solaris 2.5 and later). BLK color-sequence Specifies the color used for a block device special file. CHR color-sequence Specifies the color used for a character device special file. EXEC color-sequence Specifies the color used for a file with the executable attribute set. LEFTCODE color-sequence Specifies the left code for non-ISO 6429 terminals (see below). RIGHTCODE color-sequence Specifies the right code for non-ISO 6429 terminals (see below). ENDCODE color-sequence Specifies the end code for non-ISO 6429 terminals (see below). *extension color-sequence Specifies the color used for any file that ends in extension. .extension color-sequence Same as *.extension. Specifies the color used for any file that ends in .extension. Note that the period is included in the exten- sion, which makes it impossible to specify an extension not starting with a period, such as ~ for emacs backup files. This form should be considered obsolete. ISO 6429 (ANSI) Color Sequences Most color-capable ASCII terminals today use ISO 6429 (ANSI) color sequences, and many common terminals without color capability, including xterm and the widely used and cloned DEC VT100, will recognize ISO 6429 color codes and harmlessly eliminate them from the output or emu- late them. ls uses ISO 6429 codes by default, assuming colorization is enabled. ISO 6429 color sequences are composed of sequences of numbers separated by semicolons. The most common codes are: 0 to restore default color 1 for brighter colors 4 for underlined text 5 for flashing text 30 for black foreground 31 for red foreground 32 for green foreground 33 for yellow (or brown) foreground 34 for blue foreground 35 for purple foreground 36 for cyan foreground 37 for white (or gray) foreground 40 for black background 41 for red background 42 for green background 43 for yellow (or brown) background 44 for blue background 45 for purple background 46 for cyan background 47 for white (or gray) background Not all commands will work on all systems or display devices. ls uses the following defaults: NORMAL 0 Normal (nonfilename) text FILE 0 Regular file DIR 32 Directory LINK 36 Symbolic link ORPHAN undefined Orphaned symbolic link MISSING undefined Missing file FIFO 31 Named pipe (FIFO) SOCK 33 Socket BLK 44;37 Block device CHR 44;37 Character device EXEC 35 Executable file A few terminal programs do not recognize the default properly. If all text gets colorized after you do a directory listing, change the NORMAL and FILE codes to the numerical codes for your normal foreground and background colors. Other Terminal Types (Advanced Configuration) If you have a color-capable (or otherwise highlighting) terminal (or printer!) which uses a different set of codes, you can still generate a suitable setup. To do so, you will have to use the LEFTCODE, RIGHTCODE, and ENDCODE definitions. When writing out a filename, ls generates the following output sequence: LEFTCODE typecode RIGHTCODE filename ENDCODE, where the typecode is the color sequence that depends on the type or name of file. If the ENDCODE is undefined, the sequence LEFTCODE NORMAL RIGHTCODE will be used instead. The purpose of the left- and rightcodes is merely to reduce the amount of typing necessary (and to hide ugly escape codes away from the user). If they are not appropriate for your terminal, you can eliminate them by specifying the respective keyword on a line by itself. NOTE: If the ENDCODE is defined in the global section of the setup file, it cannot be undefined in a terminal-specific section of the file. This means any NORMAL definition will have no effect. A different ENDCODE can, however, be specified, which would have the same effect. Escape Sequences To specify control- or blank characters in the color sequences or filename extensions, either C-style -escaped notation or stty-style ^-notation can be used. The C-style notation includes the following characters: a Bell (ASCII 7)  Backspace (ASCII 8) e Escape (ASCII 27) f Form feed (ASCII 12) Newline (ASCII 10) Carriage Return (ASCII 13) Tab (ASCII 9) v Vertical Tab (ASCII 11) ? Delete (ASCII 127) nn Any character (octal notation) xnnn Any character (hexadecimal notation) \_ Space \ Backslash () ^ Caret (^) # Hash mark (#) Please note that escapes are necessary to enter a space, backslash, caret, or any control character anywhere in the string, as well as a hash mark as the first character. FILES
/etc/DIR_COLORS System-wide configuration file. ~/.dir_colors Per-user configuration file. This page describes the dir_colors file format as used in the fileutils-4.1 package; other versions may differ slightly. NOTES
The default LEFTCODE and RIGHTCODE definitions, which are used by ISO 6429 terminals are: LEFTCODE e[ RIGHTCODE m The default ENDCODE is undefined. FILES
/etc/DIR_COLORS (Slackware, SuSE and RedHat only; ignored by GNU dircolors(1) and thus Debian.) System-wide configuration file. ~/.dir_colors (Slackware, SuSE and RedHat only; ignored by GNU dircolors(1) and thus Debian.) Per-user configuration file. SEE ALSO
dircolors(1), ls(1), stty(1), xterm(1) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2001-12-26 DIR_COLORS(5)
All times are GMT -4. The time now is 01:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy