Your most favourite PS1 (.bashrc related)

Post Reply
User avatar
user1234
Posts: 413
Joined: Sat Feb 26, 2022 5:48 am
Location: Somewhere on earth
Has thanked: 154 times
Been thanked: 87 times

Your most favourite PS1 (.bashrc related)

Post by user1234 »

What's your most favourite PS1? I have got

Code: Select all

PS1="\e[1;32m\u@\H\e[0m:\e[1;34m\w\e[0m\$ "

In .bashrc which is equivalent to user@host:[output similar to pwd]$ .

Last edited by user1234 on Tue Mar 01, 2022 4:08 pm, edited 3 times in total.

PuppyLinux 🐾 gives new life to old computers ✨

User avatar
puppy_apprentice
Posts: 661
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 4 times
Been thanked: 107 times

Re: Your most favourite PS1 (.bashrc related)

Post by puppy_apprentice »

Code: Select all

PS1="\[\e[1;3$((RANDOM%7))m\][\w]>\[\e[0m\]"

Changes color (almost) every time terminal is launched.

User avatar
user1234
Posts: 413
Joined: Sat Feb 26, 2022 5:48 am
Location: Somewhere on earth
Has thanked: 154 times
Been thanked: 87 times

Re: Your most favourite PS1 (.bashrc related)

Post by user1234 »

@puppy_apprentice :thumbup: :thumbup:

PuppyLinux 🐾 gives new life to old computers ✨

User avatar
mikewalsh
Moderator
Posts: 5592
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 572 times
Been thanked: 1690 times

Re: Your most favourite PS1 (.bashrc related)

Post by mikewalsh »

@user1234 :-

Okay. Enlighten the less-well-informed amongst us, if you would?

What is a "PS1"? I always thought it referred to the Sony Playstation One..... :roll:

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

User avatar
rockedge
Site Admin
Posts: 5728
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1999 times
Been thanked: 2102 times
Contact:

Re: Your most favourite PS1 (.bashrc related)

Post by rockedge »

@mikewalsh Look at your /root/.bashrc and you will see something like :

Code: Select all

. /etc/profile

#v1.0.5 need to override TERM setting in /etc/profile...
#export TERM=xterm
# ...v2.13 removed.

#export HISTFILESIZE=2000
#export HISTCONTROL=ignoredups
#...v2.13 removed.
PS1="\[\e]2;\w\a\e[32m\]$USER\\$ \[\e[0m\]"

# enable Pkg 1.9.22 TAB completion
export PKG_TAB_COMPLETION=true
. /etc/bash_completion.d/pkg 2>/dev/null

Notice the line with PS1=, this will determine how the prompt in a terminal/console will look.

Color

Code

Black

0;30

Blue

0;34

Green

0;32

Cyan

0;36

Red

0;31

Purple

0;35

Brown

0;33

To make the color brighter replace the 0; with 1; like ->

Code

Color

Green

0;32

Bright Green

1;32


These are some more codes ->

  • \u: Display the current username

  • \h: Display the hostname

  • \W: Print the base of current working directory

  • \$: Display # (indicates root user) if the effective UID is 0, otherwise display a $

User avatar
user1234
Posts: 413
Joined: Sat Feb 26, 2022 5:48 am
Location: Somewhere on earth
Has thanked: 154 times
Been thanked: 87 times

Re: Your most favourite PS1 (.bashrc related)

Post by user1234 »

mikewalsh wrote: Tue Mar 01, 2022 2:05 pm

@user1234 :-

Okay. Enlighten the less-well-informed amongst us, if you would?

What is a "PS1"? I always thought it referred to the Sony Playstation One..... :roll:

Mike. ;)

I've kept in the subject (.bashrc related) so that confusion doesn't happens, but it still does. :lol: :lol:

PuppyLinux 🐾 gives new life to old computers ✨

HerrBert
Posts: 331
Joined: Mon Jul 13, 2020 6:14 pm
Location: Germany, NRW
Has thanked: 17 times
Been thanked: 110 times

Re: Your most favourite PS1 (.bashrc related)

Post by HerrBert »

PS1="\[\e]2;\w\a\]# "
shows the current working directory as window title

User avatar
rockedge
Site Admin
Posts: 5728
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1999 times
Been thanked: 2102 times
Contact:

Re: Your most favourite PS1 (.bashrc related)

Post by rockedge »

Code: Select all

PS1="\[\e]2;\w\a\]\\$ "
Screenshot(20).png
Screenshot(20).png (8.28 KiB) Viewed 693 times
User avatar
mikewalsh
Moderator
Posts: 5592
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 572 times
Been thanked: 1690 times

Re: Your most favourite PS1 (.bashrc related)

Post by mikewalsh »

@rockedge :-

'Kayyyy.....

Except that jrb's 'lite' spin on Barry's old Quirky64 April 7.0.1 - where I've been all day - doesn't actually HAVE this "PS1" line. Which explains why I couldn't work out what you were on about.

EDIT:- Hm. I see Bionicpup64 has this:-

Code: Select all

PS1="\[\e]2;\w\a\e[34m\]$USER\\$ \[\e[0m\]"

So why not Quirky64...? Curious. Does this normally exist in every .bashrc?

(Remembering, of course, that the 'Quirkies' were BK's original 'test series' after stepping down, where he was trying out all kinds of weird & wonderful ideas. Including moving stuff to novel locations, or altering the way things actually functioned...)

(*shrug*)

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

User avatar
rockedge
Site Admin
Posts: 5728
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1999 times
Been thanked: 2102 times
Contact:

Re: Your most favourite PS1 (.bashrc related)

Post by rockedge »

@mikewalsh Go on and add it in! Should do the trick in Quirky as well

williwaw
Posts: 1611
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 145 times
Been thanked: 293 times

Re: Your most favourite PS1 (.bashrc related)

Post by williwaw »

Code: Select all

PS1="\`if [ \$? = 0 ]; then echo \[\e[0m\]0\[\e[0m\]; else echo \[\e[0m\]1\[\e[0m\]; fi\` \w # "

shows present working directory and either 0 or 1 to indicate exit status of a command

User avatar
Grey
Posts: 1988
Joined: Wed Jul 22, 2020 12:33 am
Location: Russia
Has thanked: 75 times
Been thanked: 356 times

Re: Your most favourite PS1 (.bashrc related)

Post by Grey »

mikewalsh wrote: Tue Mar 01, 2022 2:05 pm

What is a "PS1"? I always thought it referred to the Sony Playstation One..... :roll:

Just spit on these all sorts of bash and forget about them :) Launch the DuckStation emulator, which perfectly emulates PSX-PS1.
My most favorite PS1 is Castlevania: Symphony of the Night :D
Parasite Eve is in second place :)

Fossapup OS, Ryzen 5 3600 CPU, 64 GB RAM, GeForce GTX 1050 Ti 4 GB, Sound Blaster Audigy Rx with amplifier + Yamaha speakers for loud sound, USB Sound Blaster X-Fi Surround 5.1 Pro V3 + headphones for quiet sound.

User avatar
Keef
Posts: 250
Joined: Tue Dec 03, 2019 8:05 pm
Has thanked: 3 times
Been thanked: 67 times

Re: Your most favourite PS1 (.bashrc related)

Post by Keef »

You can have a play here:
https://bashrcgenerator.com/
...and save the settings if you're happy.

User avatar
GMBudwrench
Posts: 98
Joined: Tue Feb 23, 2021 3:19 am
Has thanked: 14 times
Been thanked: 22 times

Re: Your most favourite PS1 (.bashrc related)

Post by GMBudwrench »

Added @Grey line and his Fossa ascii file. Btw Grey, Resident Evil for PS is good

Down in the thread
viewtopic.php?t=1238

HP G71 Wins10 64 bit, 2.2ghz 320gb hdd, Bionicpup64 on a WD 500gb portable HDD.

User avatar
puppy_apprentice
Posts: 661
Joined: Tue Oct 06, 2020 8:43 pm
Location: land of bigos and schabowy ;)
Has thanked: 4 times
Been thanked: 107 times

Re: Your most favourite PS1 (.bashrc related)

Post by puppy_apprentice »

GMBudwrench wrote: Tue Mar 01, 2022 11:26 pm

Down in the thread
viewtopic.php?t=1238

You can point directly to someone's post by copying link from post headline or that small icon before "by" word.
viewtopic.php?p=9267#p9267

User avatar
Grey
Posts: 1988
Joined: Wed Jul 22, 2020 12:33 am
Location: Russia
Has thanked: 75 times
Been thanked: 356 times

Re: Your most favourite PS1 (.bashrc related)

Post by Grey »

Oftopic is getting bigger :) However, the previous two links are incorrect. Here it is. However, I wouldn't call it a PS1 :)
I'm thinking how to depict a jellyfish in Ascii. I can remember the wordplay... and depict fruit jelly and fish. But somehow I don't want to :)

Fossapup OS, Ryzen 5 3600 CPU, 64 GB RAM, GeForce GTX 1050 Ti 4 GB, Sound Blaster Audigy Rx with amplifier + Yamaha speakers for loud sound, USB Sound Blaster X-Fi Surround 5.1 Pro V3 + headphones for quiet sound.

User avatar
user1234
Posts: 413
Joined: Sat Feb 26, 2022 5:48 am
Location: Somewhere on earth
Has thanked: 154 times
Been thanked: 87 times

Re: Your most favourite PS1 (.bashrc related)

Post by user1234 »

I was bored with my current PS1, so tried to copy the one that Kali uses (I suppose it does, though haven't used KaliLinux):

screenshot1.png
screenshot1.png (15.81 KiB) Viewed 169 times

Here's the code:

Code: Select all

export PS1='\e[1m\e[32m╭──(\e[34m\u@\h\e[32m)-[\e[37m\w\e[32m]
╰─\e[34m\$\e[0m '

Enjoy :thumbup2: !

PuppyLinux 🐾 gives new life to old computers ✨

User avatar
rockedge
Site Admin
Posts: 5728
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1999 times
Been thanked: 2102 times
Contact:

Re: Your most favourite PS1 (.bashrc related)

Post by rockedge »

another one borrowed from KLV-HyprlandCE ->

Code: Select all

# Bash prompt
PS1='
\e[1;35m\u\e[0;37m@\e[2;37m\h\e[0;37m: \e[0;36m\w
\e[1;34m=> \e[m'
Screenshot(2).jpg
Screenshot(2).jpg (82.42 KiB) Viewed 160 times
Post Reply

Return to “Off-Topic Area”