Sunday, June 16, 2013

Terminal: adjusting prompt and PATH variables

You will find yourself using Terminal a lot, so it is important that when it opens it is just right for you.
To change your settings in Terminal, I change .profile, but you can go specifically for .bashrc
I use GNU nano because I hate vi.

Last login: Sun Jun 16 09:18:46 on ttys003
$ nano ~/.profile


  GNU nano 2.0.6                               File: /Users/uki/.profile                                                                  

# Adjust prompt.
# \d – Current date
# \t – Current time
# \h – Host name
# \# – Command number
# \u – User name
# \W – Current working directory (ie: Desktop/)
# \w – Current working directory, full path (ie: /Users/Admin/Desktop)
export PS1="@ \W $ "

# Java
export JAVA_HOME=`/usr/libexec/java_home`

# Maven
export M2_HOME=/usr/share/maven
export PATH=${PATH}:${M2_HOME}/bin

# Android
export ANDROID_HOME=/Applications/Android/adt-bundle-mac-x86_64-20130522/sdk/
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
export PATH=${PATH}:${ANDROID_HOME}/build-tools/17.0.0

# some other things I use

# Current Project
export DEV_HOME=/Users/uki/Documents/workspaces/ .. current project ...
export PATH=${PATH}:${DEV_HOME}

# change directory to DEV_HOME
cd $DEV_HOME


^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 Text          ^T To Spell