LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-18-2021, 02:31 PM   #31
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,479

Rep: Reputation: Disabled

I don't need to know the hostname, or which directory I'm presently in, because I will be using a file manager, often mc, if I am running around in the system, & most tell you which directory you are in; if not, I'll just switch back to my home directory before doing work, (cd or cd ~).
 
Old 03-18-2021, 02:34 PM   #32
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
I like Green on Black background.
 
1 members found this post helpful.
Old 03-18-2021, 05:21 PM   #33
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
I use this:

https://starship.rs/

These are also worth checking out:

https://github.com/nojhan/liquidprompt
https://github.com/romkatv/powerlevel10k
 
1 members found this post helpful.
Old 03-18-2021, 07:25 PM   #34
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 687
Blog Entries: 1

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
For me it is:

Code:
set prompt="$HOST % "
in tcsh
 
1 members found this post helpful.
Old 03-19-2021, 02:09 AM   #35
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
Quote:
heh. Jeremy is obviously running out of ideas for polls.
heh. Maybe not.
Personally, I just accept the default and do not futz. Maintaining personal preferences across multiple systems is too much of a chore.
 
Old 03-19-2021, 05:27 AM   #36
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,567
Blog Entries: 19

Rep: Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447
Quote:
Originally Posted by jefro View Post
I like Green on Black background.
That takes me back! The first VDU terminals I ever used had that colour scheme.
 
Old 03-19-2021, 07:31 AM   #37
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,597

Rep: Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545
Quote:
Originally Posted by allend View Post
Maintaining personal preferences across multiple systems is too much of a chore.
Does it need to be more complex than "rsync -a me@primary.host:/home/me/.bashrc ~/" after the first login?

 
1 members found this post helpful.
Old 03-19-2021, 07:43 AM   #38
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,883
Blog Entries: 28

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
powerline
Attached Thumbnails
Click image for larger version

Name:	2021-03-19_07-42.png
Views:	39
Size:	28.6 KB
ID:	35873  
 
1 members found this post helpful.
Old 03-19-2021, 11:01 AM   #39
cjspizz
LQ Newbie
 
Registered: Nov 2018
Location: Rock hurtling through space-time
Distribution: Linux Mint 20.3 "Una"
Posts: 21

Rep: Reputation: 2
Question

Quote:
Originally Posted by hazel View Post
I also like an all-red prompt when I'm root.
I've had no trouble tweaking my regular user prompt, but I'd also like to tweak the root prompt to be red and yellow but can't figure out how to do that. I've searched this forum and the webs (here, here, and here were the best I found). I tried editing /root/.bashrc, but that doesn't seem to do anything. My prompt settings are in ~/.bashrc and look like this:

Code:
if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[00;32m\]u\[\033[00;37m\]@\[\033[00;32m\]\h\[\033[00;37m\]:\[\033[00;34m\]\w\[\033[00;37m\]\$\[\033[00m\] '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac
Most of what I read is someone saying 'For regular users, I use
Code:
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
and for root I use:'
Code:
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
but these are almost identical except for one color change. No one has said where to put this code or how Bash will know which to use.

Can someone please help this poor tortured soul and tell me where to put the PS1 settings for root? Or, how to I differentiate the root settings from the regular user settings?
 
Old 03-19-2021, 06:36 PM   #40
verndog
Member
 
Registered: Oct 2007
Posts: 278

Rep: Reputation: 67
favorite-> $
 
Old 03-19-2021, 07:08 PM   #41
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,725

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Re #39
Yes, the prompt for a user is defined in that user’s .bashrc Note that you’ll need to source it, or log out and back in to see any changes you make.
 
Old 03-19-2021, 07:18 PM   #42
cjspizz
LQ Newbie
 
Registered: Nov 2018
Location: Rock hurtling through space-time
Distribution: Linux Mint 20.3 "Una"
Posts: 21

Rep: Reputation: 2
Quote:
Originally Posted by verndog View Post
favorite-> $
Couldn't be less helpful. Thanks.
 
Old 03-19-2021, 07:20 PM   #43
cjspizz
LQ Newbie
 
Registered: Nov 2018
Location: Rock hurtling through space-time
Distribution: Linux Mint 20.3 "Una"
Posts: 21

Rep: Reputation: 2
Quote:
Originally Posted by scasey View Post
Re #39
Yes, the prompt for a user is defined in that user’s .bashrc Note that you’ll need to source it, or log out and back in to see any changes you make.
Would you mind elaborating? You're speaking in the short-hand of someone who knows, and I'm not able to interpret it.
 
Old 03-19-2021, 07:50 PM   #44
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,725

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by cjspizz View Post
Would you mind elaborating? You're speaking in the short-hand of someone who knows, and I'm not able to interpret it.
You asked about how to manage different prompts for different users. I pointed out that what you “understood” is correct. You need to set the prompt for each user in the user’s .bashrc...so the colored prompt for root goes in /root/.bashrc

Also, changes to a user’s .bashrc are not immediate...you’ll need to log out and back in to see them...or source the file:
Code:
. ~/.bashrc
so that the changes get read.

Last edited by scasey; 03-19-2021 at 07:51 PM.
 
2 members found this post helpful.
Old 03-19-2021, 08:26 PM   #45
cjspizz
LQ Newbie
 
Registered: Nov 2018
Location: Rock hurtling through space-time
Distribution: Linux Mint 20.3 "Una"
Posts: 21

Rep: Reputation: 2
Thanks for the clarification scasey. I think I understand now.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Poll: (Without the poll) - How is Linux used in your workplace? SlowCoder General 13 09-11-2007 11:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration