Home » Questions » Computers [ Ask a new question ]

Is there a way to hide Terminal.app's credentials (prompt text)?

Is there a way to hide Terminal.app's credentials (prompt text)?

I lose too many columns in my terminal because of the credentials ( Victor-Rodriguess-MacBook-Pro:~ victorrodrigues$ ). Could I shrink this?

Asked by: Guest | Views: 171
Total answers/comments: 1
Guest [Entry]

"What you're after is a custom bash prompt.

For just displaying the folder name, add this to your ~/.bashrc file:

export PS1=""[\w]$""

This is what it will look like (your home directory is shortened to tilde):

[~]$cd /
[/]$cd /usr/bin/
[/usr/bin]$

For an excellent overview and a list of the other available escape sequences, check out the following article: How to: Change / Setup bash custom prompt (PS1). It is a Linux tutorial but it works in bash on Mac as well."