You are not logged in.

#1 2023-11-03 15:31:36

duyinthee
Member
Registered: 2015-06-14
Posts: 242
Website

[SOLVED] ls is not showing directory color after sudo su

Sorry if it is old question. I don't find the exact one by googling. After

$ sudo su

behavior of ls has changed.
It will not show color of directory in home directory.
Is it normal?

Last edited by duyinthee (2023-11-03 15:40:09)

Offline

#2 2023-11-03 15:34:09

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,462
Website

Re: [SOLVED] ls is not showing directory color after sudo su

That's not surprising.  Colors are (generally) from a combination of an alias and environment variable(s).  These are not passed by default through sudo / su.  Also note that this can be influenced also by whether or not the regular and root user have the same shell assigned as well as perhaps other factors.

Also note that `sudo su` really doesn't make much sense.  Just use `su`, or if you do not have the root password, there is `sudo -i` (I think that's the flag).  Also read the sudo and / or su man pages for other flags if you'd like the environment to be preserved.

Last edited by Trilby (2023-11-03 15:35:15)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2023-11-03 15:39:51

duyinthee
Member
Registered: 2015-06-14
Posts: 242
Website

Re: [SOLVED] ls is not showing directory color after sudo su

thanks for explanation. Yes I would read them.

Offline

Board footer

Powered by FluxBB