LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-17-2021, 02:01 PM   #1
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,604

Rep: Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103Reputation: 4103
LQ Poll: What is your favorite Linux Prompt?


The official LQ poll series continues. This time we want to know: What is your favorite Linux Prompt?

--jeremy
 
Old 03-17-2021, 07:30 PM   #2
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
Whatever pops up when I bash in:
Code:
echo $PS1
usually:
Code:
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
that's a whole lot hu?
Code:
screenfetch
         _,met$$$$$gg.           chup@cabra
      ,g$$$$$$$$$$$$$$$P.        OS: Debian unstable sid
    ,g$$P""       """Y$$.".      Kernel: x86_64 Linux 5.10.0-4-amd64
   ,$$P'              `$$$.      Uptime: 24m
  ',$$P       ,ggs.     `$$b:    Packages: 1333
  `d$$'     ,$P"'   .    $$$     Shell: bash 5.1.4
   $$P      d$'     ,    $$P     Resolution: 1366x768
   $$:      $$.   -    ,d$$'     DE: Xfce
   $$\;      Y$b._   _,d$P'      WM: Xfwm4
   Y$$.    `.`"Y$$$$P"'          WM Theme: Default
   `$$b      "-.__               GTK Theme: Xfce [GTK2]
    `Y$$                         Icon Theme: Tango
     `Y$$.                       Font: Sans 10
       `$$b.                     Disk: 106G / 134G (80%)
         `Y$$b.                  CPU: Intel Core i5-2520M @ 2x 2.492GHz
            `"Y$b._              GPU: VMware SVGA II Adapter
                `""""            RAM: 842MiB / 4027MiB
Any GPL works tho.
 
1 members found this post helpful.
Old 03-17-2021, 07:32 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,376
Blog Entries: 28

Rep: Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162Reputation: 6162
What exactly do you mean by prompt? For example

Code:
 $
or

Code:
username@computername $
Code:
path/to/directory $
or something entirely other.

(My choice of the three above would be the last one.)
 
1 members found this post helpful.
Old 03-18-2021, 04:46 AM   #4
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,511

Rep: Reputation: Disabled
Just an indicator so that I can type the next command....
 
1 members found this post helpful.
Old 03-18-2021, 05:10 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,016

Rep: Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342Reputation: 7342
I use a lot of different computers, so I don't really care about it. I use what was configured (by default).
Code:
user@host:path$
is in general good enough (nowadays colored)
 
2 members found this post helpful.
Old 03-18-2021, 05:21 AM   #6
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
For me prompt means value of PS1, so guys just post this
Code:
$ echo $PS1
I never did this myself but think PS1 should different depending on working on /dev/pts/x or /dev/tty. On virtual terminal one use something more nice or in contrary very simply like % I use now. While on tty only % is far too cryptic.

Edit: PS1 is primary prompt. Myself never touched default PS2 and so on, but maybe someone has for some reasons customized also non-primary prompts. If I would be really interesting in reasons.

Last edited by igadoter; 03-18-2021 at 05:24 AM.
 
Old 03-18-2021, 05:43 AM   #7
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,666
Blog Entries: 19

Rep: Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490
All I need is my login name and current working directory plus $ or #. I also like an all-red prompt when I'm root.
 
1 members found this post helpful.
Old 03-18-2021, 05:53 AM   #8
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,917

Rep: Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035
heh. Jeremy is obviously running out of ideas for polls.

For the most part I just use '\$ ' as a shell prompt. Never been one for all the bling.
 
2 members found this post helpful.
Old 03-18-2021, 06:11 AM   #9
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,666
Blog Entries: 19

Rep: Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490Reputation: 4490
You do need current working directory. It's not just bling. When I was setting up my new Slackware-15, I chrooted across and just happened to be working in the /etc/rc.d directory when I forgot where I was and accidentally deleted all my startup scripts. Not a disaster at that stage, but certainly a nuisance. That was because I had not set up a proper root prompt on the new system and the default prompt just said bash# without any indication of where you were. Believe me, I corrected that before I went any further.
 
1 members found this post helpful.
Old 03-18-2021, 06:45 AM   #10
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,917

Rep: Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035Reputation: 5035
Some folks will certainly find that useful. I really dislike it when you're getting deep in the filesystem hierarchy and your prompt is taking up over half the screen width. So, I prefer to just type pwd whenever I get lost, or if I just want to confirm I'm where I think I am. Yep, I'm probably just weird, but it works for me.
 
1 members found this post helpful.
Old 03-18-2021, 07:05 AM   #11
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,150
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
Quote:
Myself never touched default PS2 and so on, but maybe someone has for some reasons customized also non-primary prompts. If I would be really interesting in reasons.
I do it in bash scripts sometimes, so it only lasts for the script, never in ~/.bashrc
Code:
#!/usr/bin/bash

col=$(tput setaf 2)
clr=$(tput sgr0)

options="q a b c"

PS3=""$col"Select an option.:  "$clr""

select opt in $options; do
    case $opt in
        q) clear; exit ;;
        a) echo "a" ;;
        b) echo "b" ;;
        c) echo "c" ;;
    esac
done
Code:
echo $PS1
[\u@\h \W]\$
 
2 members found this post helpful.
Old 03-18-2021, 07:55 AM   #12
hish2021
Member
 
Registered: Jan 2021
Posts: 117

Rep: Reputation: Disabled
Quote:
Originally Posted by GazL View Post
... I really dislike it when you're getting deep in the filesystem hierarchy and your prompt is taking up over half the screen width. ...
I use PROMPT_DIRTRIM in Bash. So my .bashrc has
Code:
PROMPT_DIRTRIM=3

Last edited by hish2021; 03-18-2021 at 08:52 AM. Reason: removed errant double-quote
 
7 members found this post helpful.
Old 03-18-2021, 08:35 AM   #13
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,155

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
never knew about PROMPT_DIRTRIM very handy thx, I learnt somthing new, don't you just love linux!

Last edited by Keith Hedger; 03-18-2021 at 08:35 AM. Reason: wish i could tpye
 
Old 03-18-2021, 08:41 AM   #14
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,155

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
login name host and folder green for normal user red for root
 
Old 03-18-2021, 08:52 AM   #15
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
Is there someone with 2-line or more prompt? I was hesitating about terminal and shell which allow to provide such cool looking prompts. 2-line prompt can be convienient to work with long paths. Say username, hostname, date/time, working directory are on top line while bottom line is for input.
 
  


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:25 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