You are not logged in.
I managed to put together some code for better aesthetics of my terminal prompt. For a user ($), it's:
PS1='\[\e[1;31m\]\u@\h\[\e[m\]:\[\e[1;34m\]\W\[\e[m\]$ 'and for root (#), it's:
PS1='\[\e[1;31m\]\u@\h\[\e[m\]:\[\e[1;34m\]\W\[\e[m\]# 'So, I managed to make it persistent by putting the ($) one in ~/.bashrc, which now looks like this:
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1='\[\e[1;31m\]\u@\h\[\e[m\]:\[\e[1;34m\]\W\[\e[m\]$ 'However, I'm still missing one piece of the puzzle. I want to force .bashrc to make different configuration "profiles" for root and for user. When I log in as root (mostly by su), I want my prompt to display '#' at the end, and when I do it as a user, I want a '$' at the end. I tried with if ... else ... fi, but it didn't work. Please, help.
Last edited by smerdjakov (2018-05-02 17:09:10)
Offline
For bash, this configuration belongs into .bashrc. You need one for your user and another for root.
https://wiki.archlinux.org/index.php/Ba … tion_files
Last edited by progandy (2018-05-02 16:56:29)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
Ah, I made another .bashrc and put it into /root directory. Now everything is as I want it to be. Thanks! ![]()
Offline