How can one change dircolors globally?

Francis (Grizzly) Smit grizzly at smit.id.au
Mon Jul 30 11:14:16 UTC 2018



On 30/07/18 21:05, Chris Green wrote:
> I suspect the answer to this may be that you can't, but I'll ask the
> question anyway.
>
> Is there any sensible/easy way to change the defaults for all users
> set up by dircolors in Ubuntu?  From reading the man pages for
> dircolors and dir_colors it would seem that it's not possible.
>
> On Ubuntu (and any Debian derived system) dircolors doesn't read
> either of /etc/DIR_COLORS or ~/.dir_colors so one can't change colors
> by creating/changing these files.  
>
> In addition, on Ubuntu at least, the dircolors command is run in each
> users' ~/.bashrc file so even putting a dircolors command in
> /etc/profile which changes the defaults won't work because it will be
> overridden by the users' dircolors.
>
> The only way I can see of doing it is to put a customised dircolors
> command in /usr/local/bin which would then be run instead of the
> default one at /usr/bin/dircolors.  This does seem a bit of a bodge
> though.  Isn't there a better way?
>
> I see that 18.04 does take account of a user's local ~/.dircolors file
> but it still doesn't have a global file.  Earlier versions don't even
> look at ~/.dircolors.
>
I'd set LS_COLORS in /etc/bash.bashrc
-- 

   .~.     In my life God comes first....
   /V\         but Linux is pretty high after that :-D
  /( )\    Francis (Grizzly) Smit
  ^^-^^    http://www.smit.id.au/





More information about the ubuntu-users mailing list