1

Working on Ubuntu (but I doubt it matters).

Our Unix servers are set up so users (read admins) have to login to their personal accounts. If you need to work as an other (say application user) you sudo su - elasticsearch for example.

I want to be able to customise the prompt for these accounts but adding a .bashrc file and setting $PS1 does not have any affect.

It is unclear to me just what su does when one specifies -. The man page is vague "Provide an environment similar to what the user would expect had the user logged in directly."

I need a pointer to some docs that explain which profile/rc files get processed in this case.

2

1 Answer 1

0

You start a login shell by issuing su -, and the file that is executed/sourced is .bash_profile.

https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html

Not the answer you're looking for? Browse other questions tagged .