Q:

dircolors: rules for _ext (rather than .ext)

In UNIX, many file extensions do not contain the dot in front, as in bashrc rather than bash.rc or ssh_config rather than ssh.config
I would like to add dircolor rules for _config as well. However, when I add the line:
_config 01;31

I get an error: dircolors: `/etc/dircolors':126: unrecognized keyword _config
Is it possible to add extensions _ext to dircolors?

A:

You can do this with *_config 01;31. 
From man 5 dir_colors:
*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 extension, 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.

A:

As @Matt has corrected me, this is possible using dir_colors. To do this you need to add a line similar to this in one of a few locations.

/etc/DIR_COLORS
$HOME/.dircolors

excerpt from man page
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.

These files are typically sourced from these files that are patched into your $HOME/.bashrc and $HOME/.bash_profile, assuming you're using Bash as your shell.
$ ls -l /etc/profile.d/|grep colorls
-rw-r--r--. 1 root root 1133 Nov  3  2010 colorls.csh
-rw-r--r--. 1 root root 1143 Nov  3  2010 colorls.sh

If you add your line to say your copy of $HOME/.dircolors:
_config 01;31

You can then update your environment using this command:
$ source /etc/profile.d/colorls.sh

You can then confirm that your environment now includes the change:
$ env|grep -o '*_config=01;31'
*_config=01;31

Finally you can test to see if your change is working:
$ touch afile_config
ls -l afile_config

              

