Removing user from prompt

Discussion in 'Mac Basics and Help' started by tirwit, Jul 19, 2010.

  1. tirwit macrumors newbie

    Joined:
    Jan 20, 2010
    #1
    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:~ $ 
    
     
  2. psxguru macrumors 6502a

    Joined:
    May 19, 2006
    #2
    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).
     
  3. tirwit thread starter macrumors newbie

    Joined:
    Jan 20, 2010
    #3
    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
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    Try editing the .bashrc file in your home directory rather than the one in /etc.
     
  5. tirwit thread starter macrumors newbie

    Joined:
    Jan 20, 2010
    #5
    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
     
  6. mac2x macrumors 65816

    Joined:
    Sep 19, 2009
    #6
    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.
     

Share This Page