Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I carelessly entered a command in the terminal that should have been in a shell script:

export PS1=$PATH:~/drush23/drush/

now in my terminal instead of this:


I see this:


and when I change directories this line always stays... I don't know what to do

I have byobu...

share|improve this question
up vote 9 down vote accepted

$PS1 is an environment variable that tells yours shell how to format the prompt. Changing the value with export, as you did, only applies to that session; so you can just open up a new shell (not a sub-shell) and see a familiar prompt.

Otherwise, if you really want your prompt back in this session itself, just rerun your shell's preferences file. For Bash users, that is:

. ~/.bashrc

I don't know if that will work (at least, without causing other issues) for Byobu; but you can just set the prompt to a sane value like this:

export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

Or, if you don't want to or can't have a color prompt, a simpler one would be:

export PS1='PS1='\u@\h:\w\$ '

where \u is your username, \h is your hostname, and \w is the full (logical) path of your current working directory.

share|improve this answer
i wasn't aware the $PS1 controlled that... thanks! – Moshe Shaham Apr 23 '14 at 12:23
just hit in terminal . ~/.bashrc. It will reset PS1 variable and you should get back your prompt. – souravc Apr 23 '14 at 18:33
@souravc Are you sure that wouldn't cause problems for the OP? he's using Byobu. – YatharthROCK Apr 24 '14 at 9:45
@YatharthROCK I don't think it would cause any problem. What are you expecting as possible problem? – souravc Apr 25 '14 at 4:16
@souravc Sorry, wasn't thinking straight. – YatharthROCK Apr 25 '14 at 6:07

You can set PS1 to a reasonable value for this Terminal session using:

export PS1=$'\h:\w\$'

The old value should also be restored after closing and restarting Terminal, a reboot, etc.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.