-
-
Save vargeorge/8b20488b7d7b6c101b4b to your computer and use it in GitHub Desktop.
1. Edit ~/.bash_profile and add the following line to show full path before the $ prompt. | |
For example, as user@hostname:path/to/directory$ | |
# show path before the $ prompt | |
export PS1='\u@\H:\w$ ' | |
2. Save file and restart terminal or run source command | |
$ source ~/.bash_profile | |
nice, thank you.
I used this, because of my long hostname : export PS1='\u@\h:\w$ '
Explanation of what this is doing:
- '\u' is the username under which you are currently logged in to your computer.
- '\h' is the host machine's name
- '\w' is where you currently are in the file structure
- '$' is the prompt symbol
So if you just want to know where you are and see the prompt you can edit your bash profile to be just '\w
On Big Sur it somehow prints the expression:
\u@\H:\w$
Never worked with zsh before. Does zsh use another config file than bash?
On Big Sur it somehow prints the expression:
\u@\H:\w$
Never worked with zsh before. Does zsh use another config file than bash?
I have the same issue
@mirisbowring @KienPM I have faced the same issue.
I helped to me to switch to bash from zsh in system settings: https://stackoverflow.com/a/59439507
Also try (additionally, it is optional) to prompt exec bash
and reload terminal.
@mirisbowring @KienPM I have faced the same issue.
I helped to me to switch to bash from zsh in system settings: https://stackoverflow.com/a/59439507
Also try (additionally, it is optional) to prompt
exec bash
and reload terminal.
Thanks for responding
On Big Sur it somehow prints the expression:
\u@\H:\w$
Never worked with zsh before. Does zsh use another config file than bash?
add PROMPT='%~ %n@%m:%# ' to ~/.zshrc
Works like a charm. Cheers.