How to set PATH variable on mac

i was playing around with node.js and wanted to add the PATH variable on my mac. After updating the .bash_profile file, i realised I messed up something as none of the command worked. i.e when I tried ‘ls’ I got -bash: ls: command not found 

panicked for a sec, but then it’s obvious what I’ve done, so sorted out the issue by trying the below command on a terminal:

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

If you think it will be easy using a text editor, then try the below command:

 touch .bash_profile 
 open -a TextEdit.app .bash_profile

incase if you would like to add another path, the easy way is to do the following;

export PATH=/your/new/path:$PATH

Do not forget the :$PATH variable at the end of your new path.

After setting the environment Path you can verify with echo $PATH command.

Note: This is a typical Path variable in Mac OS X Lion