Thursday, May 2, 2024
13
rated 0 times [  13] [ 0]  / answers: 1 / hits: 16838  / 2 Years ago, thu, may 5, 2022, 2:24:18

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:



ubuntu@ip-10-16-134-18:/home/ubuntu$


I see this:



/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/ubuntu/drush23/drush/


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



I have byobu...


More From » command-line

 Answers
2

$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 colour prompt, a simpler one would be:



export 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.


[#25758] Thursday, May 5, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
attagjump

Total Points: 272
Total Questions: 127
Total Answers: 124

Location: Taiwan
Member since Fri, Sep 17, 2021
3 Years ago
;