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-19-2021, 10:43 PM   #46
verndog
Member
 
Registered: Oct 2007
Posts: 279

Rep: Reputation: 68

Quote:
Originally Posted by cjspizz View Post
Couldn't be less helpful. Thanks.
The topic says, What is your favorite Linux Prompt? Not how to create your favorite Linux Prompt.

Last edited by verndog; 03-19-2021 at 11:35 PM.
 
Old 03-20-2021, 02:00 AM   #47
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by scasey View Post
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:
Partially true. To play with prompt just export PS1
Code:
$ export PS1="your AI computer hates you (lo)ser "
 
1 members found this post helpful.
Old 03-20-2021, 04:12 AM   #48
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,736

Rep: Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213
Quote:
Originally Posted by igadoter View Post
Partially true. To play with prompt just export PS1
Code:
$ export PS1="your AI computer hates you (lo)ser "
Point taken...but I’ve always found it easier to just source the login scripts when tweaking them. Still, good advice.
 
Old 03-20-2021, 08:57 AM   #49
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
The topic says, What is your favorite Linux Prompt? Not how to create your favorite Linux Prompt.
Yes, I can see that. I didn't think it was going off topic to simply ask how people make a separate prompt for root. I apologize to all for such an egregious violation of the forum rules.
 
Old 03-20-2021, 11:58 AM   #50
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,146

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
PCLinuxOS defaults to
Code:
PS1="[\u@\h \W]\\$ "
Since I know my own name, don't care what the computer is called, don't know what the brackets are for, and can tell root use from things turning red, I prefer
Code:
PS1="\W \$ "
 
Old 03-21-2021, 12:50 PM   #51
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,808

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
For non-root accounts:
Code:
your-name-here@host:last-element-of-pwd $
in cyan.

For root:
Code:
root@host:last-element-of-pwd #
in red.

On one project, the lead had me set up a prompt for all users that had a red background and blinked whenever the developers had gotten sloppy and were getting close to filling up the test filesystems on the NAS. (It was really annoying but it got the point across. :^D )
 
Old 04-01-2021, 05:27 PM   #52
ArfaSmif
Member
 
Registered: Oct 2008
Location: Brisbane Australia
Distribution: Fedora, Centos, Manjaro
Posts: 317

Rep: Reputation: 70
I like

echo $PS1

giving me

[\w]$
 
Old 04-01-2021, 06:02 PM   #53
skbranch3
LQ Newbie
 
Registered: Jul 2004
Location: saskatchewan canada
Distribution: slackware64 current
Posts: 17

Rep: Reputation: 2
login name host and folder, green for normal user, red for root and as of just now PROMPT_DIRTRIM=3. Also have the slackware line art in my .bashrc.
 
Old 04-01-2021, 07:30 PM   #54
tekra
Member
 
Registered: Aug 2010
Location: Brisbane, Australia
Distribution: Gentoo, Slackware, PCLOS, Debian
Posts: 230
Blog Entries: 2

Rep: Reputation: 50
qtm:~># echo $PS1
\[\e[1;31m\]\h:\[\e[1;33m\]\W\[\e[1;36m\]>\$ \[\e[0;32m\]
qtm:~># cd /work/Electronics/Oscilloscopes
qtm:Oscilloscopes>#

Last edited by tekra; 04-01-2021 at 07:33 PM.
 
Old 04-01-2021, 07:53 PM   #55
SteveG_0001
LQ Newbie
 
Registered: Mar 2015
Posts: 17

Rep: Reputation: Disabled
PS1="> "
No colours. Who can read red or blue or purple on black? Or yellow on white?
 
Old 04-01-2021, 07:59 PM   #56
Fjor
LQ Newbie
 
Registered: Oct 2004
Location: Jalisco, Mexico
Distribution: Slackware
Posts: 24

Rep: Reputation: 5
The bare minimum

I work with a lot of servers daily and mainly at the Bash prompt. I have used this two line prompt for years:
Code:
export PS1="\t - \d - Dir: \w\n\u@\h\$ "
resulting in something like
Code:
18:50:21 - Thu Apr 01 - Dir: /current/directory
user@someserver#
This way the typing always start in the same column independent of the current path length, I do not lose track of time so easily and could use it to estimate time of processing commands when I don't want the precision of the time built-in.
 
1 members found this post helpful.
Old 04-01-2021, 08:16 PM   #57
apink
LQ Newbie
 
Registered: Jan 2013
Posts: 14

Rep: Reputation: Disabled
look@theEmperorsNewClothe$
 
Old 04-01-2021, 09:15 PM   #58
jhumphrey
Member
 
Registered: Jan 2019
Location: United States
Distribution: CentOS, OpenBSD
Posts: 60

Rep: Reputation: Disabled
My favorites are `$` and `%`
Having the time is also handy.
Currently my terminal prompt on one OS is
Code:
\[\e[42m\e[37m\][\A]\[\e[0m\] \[\e[0m\e[33m\]\u\[\e[0m\]@\[\e[36m\]\h\[\e[32m\]:\j\[\e[0m\]\$
And my PS2 is
Code:
\e[41m\e[32m?\e[37m>
My all-time favorite prompts though are ':' and '' Colon because I am in vi, and nothing because I am in ed(1) (Okay, I know it is * on some setups.)

This results in something like
Code:
[12:27] ghenghis@khan:0$
But with colors

Last edited by jhumphrey; 04-01-2021 at 09:18 PM. Reason: add result
 
Old 04-01-2021, 10:09 PM   #59
DavidAames
LQ Newbie
 
Registered: Feb 2021
Posts: 4

Rep: Reputation: Disabled
Kali Linux/ZSH

┌──(kali㉿kali)-[~]
└─$ echo Hello World. I'm $0
Hello World. I'm zsh

┌──(kali㉿kali)-[~]
└─$
 
Old 04-01-2021, 10:22 PM   #60
grizzlysmit
LQ Newbie
 
Registered: Sep 2010
Posts: 8

Rep: Reputation: 2
Quote:
Originally Posted by jeremy View Post
The official LQ poll series continues. This time we want to know: What is your favorite Linux Prompt?

--jeremy
liquidprompt https://github.com/nojhan/liquidprompt https://liquidprompt.readthedocs.io/en/stable/

Last edited by grizzlysmit; 04-01-2021 at 10:38 PM.
 
1 members found this post helpful.
  


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 10:13 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