Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tirwit

macrumors newbie
Original poster
Jan 20, 2010
28
0
Hi

My prompt in Terminal looks like this:

Code:
MacBook-de-Pedro-Gordo:~ Pedro_Gordo$

How can I remove permanently my username (Pedro_Gordo) from the prompt, so it looks like this:

Code:
MacBook-de-Pedro-Gordo:~ $
 
I presume you're using bash so simply edit the bashrc file

ie

vi /etc/bashrc

change the line...

PS1='\h:\W \u\$ '

to

PS1='\h:\W \$ '

save, logout and log back in to see the changed prompt.
You'll probably have to sudo and also override the readonly warning when saving (bashrc should be readonly).
 
I did it. X11 is displaying the prompt as I want, but Terminal is not. I can't remove the user (option in PS1: \u). This is my .bashrc file:

Code:
export PS1='\h:\W \$'

# root
export ROOTSYS=/Users/Shared/root

export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/Aplicações:$ROOTSYS/bin:/usr/local/bin

# root
export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$ROOTSYS/lib:$DYLD_LIBRARY_PATH

Any idea why I can't remove the user from prompt? My OS X is the 10.6.4
 
Problem solved, but it was solved in the course of other thing, so I can't specifically identify what I did to solve this! :p

Thanks anyway
 
I suggest changing your machine name to something less clunky & identifying too. :) You can do that in System Preferences in the Sharing pane. I like to use the names of Native American tribes for my computers.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.