How can one change dircolors globally?

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



On 30/07/18 21:41, Chris Green wrote:
> On Mon, Jul 30, 2018 at 09:14:16PM +1000, Francis (Grizzly) Smit wrote:
>>
>> 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
> That won't work because it will be overridden by the setting in each
> user's ~/.bashrc.
>
if you wish to force the individuals choice then I suspect your out of
luck, the whole point of Linux is user choice and GNU is the same, hence
bash will let you set defaults, but I doubt it will let you force the
choice, if it did it would be a bug, and would need fixing

-- 

   .~.     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