A string of characters displayed by interactive shells to signal the shell is waiting a user input. The prompt can be used to display variables and data about the enviornment.

learn more… | top users | synonyms

3
votes
3answers
368 views

New bash prompt causing issues

I changed my bash prompt to this: PS1="\[\033[1;31m[\[\033[1;33m\$(date +%H:%M)\[\033[1;31m] \u:\[\033[1;32m\W\[\033[1;37m\$\[\033[0m\] " Sorry for the long line, it is mostly due to colors. ...
1
vote
1answer
169 views

why does it take long for the bash prompt to return on high system load [closed]

When my server experiences high load and I run a command, there is a long delay after the command has finished before I get the prompt again. Any idea what is causing this?
3
votes
2answers
129 views

Modify prompt based on value

Suppose I have an environment variable defined in .bash_profile like this: PS1='\[\e[31;1m\][\u@\h \T \w] \[\e[0m\]' This variable makes my Linux prompt show certain information, like thes: ...
12
votes
2answers
358 views

Possible to configure Login TTY over Audio device (Morse code or similar)?

One of the most miserable aspects of my day job is the need to occasionally investigate problems with machines scattered in remote locations all over the world that don't have network access to the ...
1
vote
1answer
641 views

When a command is over half the terminal size it breaks

Whenever I type in a bash command longer than about half the width of the shell window I'm in, the command breaks like it would if I filled the whole screen 3rd command in image - typed a few xs ...
5
votes
1answer
363 views

history list in bash always truncated to 5000 lines at new login

Similar to the 5000 line limitation problem when first thing in .bashrc I have export HISTSIZE=10001 and export HISTFILESIZE=$HISTSIZE My users do not have ~/.inputrc files and the system-wide ...
2
votes
1answer
356 views

Prompting for input in post-install script in dpkg

I am writing a debian package and need to prompt the user for some textual details(default password, etc), as well as some one-of-many choices("Pick one of the following: foo, bar"). Will shell ...
1
vote
3answers
354 views

Reevaluate the prompt expression each time a prompt is displayed in zsh

I'm adjusting my zsh prompt, based upon the dallas theme and the dstufft theme from oh-my-zsh. I love how dallas has various sections of the prompt contained in variables, which makes it much easier ...
3
votes
2answers
4k views

executing if-statement from command prompt

In bash I can do the following: if [ -f /tmp/test.txt ]; then echo "true"; fi However, if I add sudo in front, it doesn't work anymore: sudo if [ -f /tmp/test.txt ]; then echo "true"; fi -bash: ...
4
votes
3answers
739 views

Colored text set up with PS1 and colored output from commands mess each other up

I have PS1 that ends with an opening color sequence (like \[\e[0;32m\]) to have all text in the terminal colored (green in this case). However, when I use a command such as ls (which is aliased to ls ...
2
votes
2answers
639 views

How to get green/red terminals under OpenBSD?

For linux machines I can use: # vi ~/.bashrc # red/green terminal colors regarding exit code export PROMPT_COMMAND='PS1="` if [[ \$? = "0" ]]; then echo "\\[\\033[0;32m\\]"; else echo ...
2
votes
0answers
177 views

What is and how to use PS1 \#

I put this is .bashrc # colors NC="$(tput sgr0)" RED="$(tput setaf 1)" GREEN="$(tput setaf 2)" # etc ... PS1="\[$BROWN\]\u \[$CYAN\]#\# \[$PINK_BLD\]!\!\[$NC\] \[$BLUE\]\W: \[$NC\]" So deepo #50 ...
2
votes
2answers
682 views

Bash prompt when my home directory is a symbolic link

I symlinked my /host/Users/Kevin folder to /home/Kevin. I also edit the /etc/passwd file to /home/Kevin. I logged out and logged back in, however when I open up a terminal it's a bash prompt like so: ...
8
votes
4answers
6k views

How to make the terminal display user@machine in bold letters?

I have seen in some screen-shots (can't remember where on the web) that the terminal can display the [username@machine /]$ in bold letters. I'm looking forward to getting this too because I always ...
2
votes
1answer
387 views

Is it possible to customise the prompt to show the if there are any background jobs?

Is it possible to customise the bash prompt to show the if there are any background jobs? I find it easy to forget that there are background jobs. Say if the prompt was... $ Is there a way to ...
7
votes
3answers
563 views

Can I highlight the current prompt line in zsh?

Is it possible to highlight (set a background colour) for the whole line of the prompt in zsh? In my emacs config I have the line on which the cursor sits a slightly different colour to the window ...
2
votes
1answer
226 views

ZSH %m prompt escape not working as documented under Debian Linux

The zshmisc man page on my new Debian Squeeze install states, under SIMPLE PROMPT ESCAPES: %m The hostname up to the first `.'. An integer may follow the '%' to specify how many components of the ...
2
votes
2answers
278 views

Shell Prompt Customization? [closed]

I have used oh_my_zsh (and tinkered with bash_it) on multiple systems and have generally been happy with it, though I hate it's auto-correction feature and generally turn it off. My usual shell is ...
4
votes
2answers
827 views

Admin user not showing directory path in console prompt, only $

I have an Ubuntu server that I administer through ssh. When I login as root I get a full path in the prompt, like /var/www. I created a user with sudo privileges for the purpose of administration. ...
0
votes
2answers
246 views

pwd not being set correctly in zsh prompt

If I type this in my PROMPT in my .zshrc file: PROMPT="`pwd` >" I expect that it will print the current working directory. However, pwd always prints /Users/kevin. Why doesn't it show my current ...
3
votes
1answer
1k views

Set variables in ZSH precmd and reference them in the prompt

Is there a way to set variables in the precmd function of zsh and then echo them in the prompt? Something like function precmd { GREETING='Hi Kevin!'; } PROMPT="$GREETING";
1
vote
0answers
112 views

Doubt on the value of PS1 environment variable [duplicate]

Possible Duplicate: What is $debian_chroot in .bashrc? In Bash, why is PROMPT_COMMAND set to something invisible? I logged into my computer from a normal user and executed the following ...
2
votes
1answer
292 views

vi mode doesn't display correctly on new term

This is a continuation of my previous questions. I currently have the following in ~/.zsh.d/functions.sh function zle-line-init zle-keymap-select { psvar[1]="${${KEYMAP/vicmd/}/(main|viins)/-- ...
7
votes
1answer
726 views

Why is my bash prompt getting bugged when I browse the history?

Often when I start looking at history of commands some of the characters from a command displayed aren't erased, for example: What's happening: prompt$ some_command prompt$ some_commanother_command ...
5
votes
1answer
1k views

In Bash, why is PROMPT_COMMAND set to something invisible?

On RHEL6 and CentOS 6, /etc/bashrc sets PROMPT_COMMAND here: case $TERM in xterm*) if [ -e /etc/sysconfig/bash-prompt-xterm ]; then PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm ...
8
votes
4answers
1k views

Abbreviated current directory in shell prompt?

vim has a really nice feature which it utilizes in its paths when they're a bit long: It abbreviates the path to the document in the tab at the top. Is there a way to do something similar to this ...
2
votes
0answers
296 views

Populate PS1 asynchronously

I have a few git svn related functions that see if I have to pull/push from/to the repository. My problem is that the functions I've wrote to gather these informations are too slow, I'd like to make ...
2
votes
1answer
1k views

Multiline PS1 prompt

Is the a way to specify a multi line prompt in Korn shell? I am planning to swhitch from bash to ksh. In bash I have a very simplistic prompt, but it is 2 line prompt. I hate when input position ...
5
votes
2answers
268 views

Display Non-Zero Return Status in PS1

I want to include the return status in my prompt. (Easy add '$? ', right?) However, I only want the status returned (and trailing space) if non-zero. Example: sd ~ $ false 1 sd ~ $ true sd ~ $
2
votes
1answer
388 views

There is no bash indicator prompt after a forked process terminates

I am reading the book Advanced Programming in the Unix Environment. There is a test program to test the fork function. It works well in my Ubuntu. But what I confused is that why there is no command ...
6
votes
3answers
551 views

Bash history number not starting at 1?

I was customizing my bash prompt (I'm on OS X 10.7) when I came across something strange. Within my prompt I included !, which should give me the history number. However the history number always ...
3
votes
2answers
969 views

Bash prompt keeps disappearing

I have a weird issue where my Bash prompt often completely disappears on a backspace. Doesn't make any sense to me, but it happens often: I can't really think of why this is happening. Am I ...
5
votes
5answers
325 views

Conflict between my prompt definition and cat in zsh

I have a file on a remote filesystem that I know has a short text string in it (a sequence of numbers in a single line). If I open the file on a text editor like nano or Emacs I can see the string. ...
3
votes
1answer
2k views

Showing GNU screen session name and window title in shell prompt

Is there a way to present the GNU Screen session name and window title in the prompt of the shell (let us say, the Bash prompt defined by PS1)?
2
votes
1answer
2k views

How do I customize the bash prompt on centos?

I've altered the /etc/bashrc file. I commented out the previous definition and inserted my own: PS1="--bash: (\u@\h:\w) $" This is not having any affect. When I make this change at the command ...
4
votes
4answers
916 views

Which stream does Bash write its prompt to?

I am trying to redirect all output from bash (prompt, user input, results) to a file Example: /bin/bash > file.txt 2>&1 I thought that would work, but I'm not getting the prompt. Can ...
1
vote
2answers
541 views

Unix read -p command causes bash error, how do I fix it?

I'm trying to prompt the user for a comment function comment { if [ ! $1 ] then read -p "enter checkin comment < " COMMENT; else export COMMENT="$1" fi if [ ! $COMMENT ] ...
6
votes
1answer
186 views

How can I output “temporarily” to the shell, like zsh tab completion does?

In zsh shell, when you hit Tab twice to get tab completion, your options are displayed below your prompt. But when you make a selection, the options disappear. I have a little script that outputs ...
13
votes
2answers
1k views

Display command in xterm titlebar

My Bash Prompt is currently setting the xterm titlebar using the following sequence: PS1='\033]0;\u@\h>\w\007' Is there an easy way to display the current command in the titlebar. For example, ...
1
vote
1answer
128 views

Printing evaluated prompt placeholders to screen

Is there a way to print interpreted PS1 variable placeholders to console? Something like $ echo `%u` for printing a username or $ echo `%h` for printing a host. I do know about environment ...
8
votes
1answer
4k views

How to change tty login prompt?

To be clear, I am not referring to /etc/issue (shown before the prompt) or /etc/motd (shown after login), but the prompt itself, which is currently hostname login: For good measure, I am running ...
8
votes
2answers
3k views

How can I change what's displayed at a login shell?

I'm getting more familiar with tweaking the way things look in a shell via the prompt (.bashrc), but I'm now trying to change the initial stuff displayed when I first log in. On my EC2 instance, this ...
2
votes
5answers
5k views

In bash how can I change the color of my command prompt? [duplicate]

Possible Duplicate: How to customize .bashrc to configure command prompt? When I run a command, I often times have trouble finding the beginning of the command output. An easy fix to this ...
4
votes
1answer
189 views

terminal - having “$” instead of MyComputer:~ me$

Right now in my MacOS X terminal I have MyComputer:~ me$ before all the commands. In some videos I saw they have just $ - that's much less clutter, how is it done?
8
votes
2answers
1k views

How do you make RPROMPT in zsh update itself on every enter?

My RPROMPT is set to display svn info using vcs_info. It reads RPROMPT=${vcs_info_msg_0_}. vcs_info is called using precmd(). However, RPROMPT doesn't update when I change directories. It works only ...
3
votes
2answers
839 views

Strange Character in my Bash prompt?

I'm somewhat new to Bash prompts, but I was finally able to get things somewhat working. However, I have a strange character at the beginning of my prompt: Here's my actual PS1 prompt: ...
3
votes
1answer
224 views

ssh behavior for root and non-root user

When I ssh as root to a remote machine, the command output looks like this: root@Machine:/current/path#: However, if it's a non-root user, all I see is: $ How can I get the same behavior as for ...
3
votes
3answers
740 views

Is there a way to make the prompt definition multiline?

This is my current prompt definition: PS1=$'%F{063}%1~%f %(1v.%F{099}%1v %f.)%F{063}%%%f ' RPROMPT='$VIMODE %m' and I'm working on integrating this. Basically I'm starting to find it very ...
3
votes
3answers
1k views

How to customize .bashrc to configure command prompt?

Is there an easy way to change my Bash prompt to modify the colors and what text is displayed? I've heard that this is done in .bashrc, but I haven't found any nice, easy ways of modifying it. How are ...
4
votes
1answer
544 views

Re-escape brackets in PS1

As others have pointed out, color codes in PS1 should be bracketed by \[ and \] to avoid them taking up horizontal space. I've added the necessary code to .bashrc: highlight() { if [ -x ...