Questions tagged [ps1]
The ps1 tag has no usage guidance.
43
questions
4
votes
1
answer
2k
views
PS1 window title under PuTTY with GNU screen
I'm currently setting my PS1 title with by concatinating three variables in my .bashrc in such a way:
export TERMSERVER=`who am i | awk '{print $NF}' | tr -d ')''('`
if [ -n "$TERMSERVER" ] ; then
...
0
votes
1
answer
139
views
Prompt Customization Query - PS1='[\u@\h]\!:echo $? $ '
If in .bashrc the following reports the 'history number of the current command' (and the exit code of the last command), how can I configure it to report the 'history number of the previous command'?
...
0
votes
3
answers
5k
views
How to change the PS1 value.
I am logged in as the root of a Linux 2.6.18 machine. I changed the value of PS1 as:
export PS1="$PWD> "
It works and hardcodes the command prompt as the home directory followed by a >. Now I ...
2
votes
1
answer
944
views
How can I set `less` or `more` max lines (scrollable height) limit/boundary in linux?
(Sorry for the title. Any suggestions?)
I've set my commandline PS1 to cover 3 lines:
white space
user, server and pwd
$ or # to input
I think less (or more?) is configured to break after window's ...
4
votes
3
answers
868
views
Make Bash's PS1 show original directory name and not symlink?
I currently have PS1='\W' but when in a symbolic link'd directory, the prompt shows the symlink name, how can I make PS1 to show the original directory name?
40
votes
2
answers
12k
views
Linux: coloring bash prompt will break carriage return
When I try to colorize the bash prompt like this:
export PS1="\e[0;31m[\u@\h \W]\$ \e[m "
it breaks the carriage return (instead of going to a new line when line is full, it starts in the same line ...
1
vote
1
answer
376
views
PS1 problem, cmd is looping [duplicate]
I've set PS1 to the following value:
PS1="\033[0;37m[\033[1;33m\w\033[0;37m]\n\t \[[34m\]\u\033[0;37m@\[[34m\]\[[1m\]\h\[(B[m\] $"
The problem is that any command spanning more than a line loops ...
2
votes
1
answer
880
views
What prompt is sh using when you type sh into Terminal?
When using the default PS1 prompt that MAC OS/Terminal comes with, when you type sh you get a new style prompt.
station-4:~ user$ sh
sh-3.2$
When you export your own PS1, this functionality goes ...
1
vote
1
answer
177
views
Formatting my $PS1 to x amount of character
I'm looking for a way to force my PS1 variable to a certain number of chars.
It currently looks like:
$PS1="\W $"
and I'm trying to keep the same number of characters regardless of the length of ...
9
votes
5
answers
6k
views
Set $PS1 differently on local computer and in ssh session
I keep my home directory under version control, so that my basic configuration is easily available on any computer.
My bash command prompt on my local computer is a complicated, colorful thing that ...
5
votes
2
answers
6k
views
How can I change my prompt to include box drawing Unicode characters?
How can I get a $PS1 containing box-drawing characters?
I am running bash, if it makes a difference.
28
votes
9
answers
35k
views
Right align part of prompt
I am sure that I have seen someone have a part of their prompt aligned to the right in their terminal window and then have the actual cursor start on a second line. I know that I can achieve the ...
4
votes
1
answer
2k
views
Why is my bash prompt repeating its last line twice, when I ls, or cd or issue misc commands?
My prompt is such:
PS1="\[\033[32m\]\u@myserver\n\[\033[33m\w$\033[0m\] "
So as output after I ls i see this:
jake@myserver
~/public_html$
~/public_html$
When I should only (I think) see:
jake@...