editing .bashrc

Discussion in 'OS X' started by macsig, Apr 17, 2010.

  1. macrumors regular

    Joined:
    Oct 27, 2006
    Location:
    Marina del Rey, CA
    #1
    Hello guys,
    How can I edit .bashrc ?
    I'm playing around with RVM and I need to add a line at the end of that file but I have no idea how to do that.

    Thanks
     
  2. Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    If you don't know how to edit you may want to rethink editing it as it can cause problems if you mess up. But if you want to, just open Terminal and enter the following.
    Code:
    pico ~/.bashrc
    or to open in TextEdit.
    Code:
    open -t ~/.bashrc
     
  3. thread starter macrumors regular

    Joined:
    Oct 27, 2006
    Location:
    Marina del Rey, CA
  4. macrumors 65816

    Joined:
    Sep 19, 2009
    #4
    Another handy tip for the command line is the more command, which lets your view documents like .bashrc without opening an editor. Obviously, you must open it in a text editor to actually change anything.

    Code:
    $ more .bashrc
     
  5. macrumors 6502a

    Hal Itosis

    Joined:
    Feb 20, 2010
    #5
    FWIW, pico has been removed from OSX (since Tiger i believe) and replaced with nano.

    Apple has provided a symlink, so that the "command" pico will still appear to function:
    Code:
    $ [COLOR="Blue"]type -a nano pico[/COLOR]
    nano is /usr/bin/nano
    pico is /usr/bin/pico
    
    $ [COLOR="Blue"]ls -l `whereis nano pico`[/COLOR]
    -rwxr-xr-x  1 root  wheel  297424 Sep 23  2007 /usr/bin/nano
    lrwxr-xr-x  1 root  wheel       4 Mar 14  2009 /usr/bin/pico -> nano
    
     
  6. macrumors 6502a

    Joined:
    Oct 13, 2007
    #6
    This is fairly standard in *nix's. nano was designed to be a drop-in replacement for pico, and you have to be pretty savy to tell them apart.
     
  7. macrumors 6502a

    Hal Itosis

    Joined:
    Feb 20, 2010
    #7
    I know what you mean, but i couldn't resist...
    Code:
    $ [COLOR="Blue"]pico foo[/COLOR]
    
    GNU [COLOR="Magenta"][B][SIZE="3"]nano[/SIZE][/B][/COLOR] 2.0.1[SIZE="1"]                 File: foo
    _
    
    
    
    
                                    [ New File ]
    ^G Get Help ^O WriteOut ^R Read File^Y Prev Page^K Cut Text ^C Cur Pos
    ^X Exit     ^J Justify  ^W Where Is ^V Next Page^U UnCut Tex^T To Spell
    [/SIZE]
    ;) (at least that's what an OSX user gets)
     

Share This Page