I lose too many columns in my terminal because of the credentials ( Victor-Rodriguess-MacBook-Pro:~ victorrodrigues$ ). Could I shrink this?
The only information I see as really needed sometimes for me is the folder name, nothing else.
I lose too many columns in my terminal because of the credentials ( Victor-Rodriguess-MacBook-Pro:~ victorrodrigues$ ). Could I shrink this?
The only information I see as really needed sometimes for me is the folder name, nothing else.
As a general note:
The bash session started by Terminal.app is usually a login session. (You will see the difference as the login session will tell you about your last login on startup.) This can be changed in the preferences where you can choose between /usr/bin/login and a custom command.
Login sessions don’t usually execute the scripts in ~/.bashrc but look for /etc/profile, ~/.bash_profile, ~/.bash_login, and ~/.profile. (See man bash.) However, /etc/profile will also call /etc/bashrc, so that the changing this file gave the appropriate results.
To get consistency over login and non-login shells, one usually changes ~/.profile to also execute the ~/.bashrc file and includes all changes for login and non-login shells to the latter.
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.
.bashrcand add that line to it. I believe you can also edit/etc/bashrcfor system-wide changes. – Feb 14 '10 at 09:22