1

When I run the ls command using sudo-powers the file and directory names are all in white. When I run it as user the directory names are in bluish-purple, the scripts are in green and and the Asembler program is in white.

I did do a modification to from "color-prompt = YES" or something like that in some place but I don't remember configuring colour file names based on my User ID.

Example

Sudo colours

I like the coloured file types, how can I extend this to sudo?

WinEunuuchs2Unix
  • 99,709
  • 34
  • 237
  • 401
  • 1
    Does `sudo ls --color=auto` work? – fkraiem Nov 09 '16 at 01:59
  • @fkraiem Yes it does! Do you want to post that as an answer? I'll upvote it of course but can it be automated? – WinEunuuchs2Unix Nov 09 '16 at 02:01
  • 1
    Very probably your `ls` is aliased to `ls --color=auto` (run `alias` to find out), but when you run `ls` with `sudo` the alias is not kept. I cannot think right now of a way to keep it... – fkraiem Nov 09 '16 at 02:09
  • Indeed something has set up an "alias ls='ls --color=auto'" plus 7 other aliases including three for `egrep`, `fgrep` and `grep` (the first two I"ve never heard of) so it's an interesting situation. Does the same happen on your terminal? – WinEunuuchs2Unix Nov 09 '16 at 02:40
  • 1
    Yes, those aliases are set in `~/.bashrc` by default. – fkraiem Nov 09 '16 at 02:52
  • I believe it was in `~/.bashrc` I set the "color-prompt= YES" or something like that for my User ID. Do I have to do the same for root some how? – WinEunuuchs2Unix Nov 09 '16 at 02:55

0 Answers0