Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
What are PATH and other environment variables, and how can I set or use them?

Every time I open my secureCRT window,I need to run the below to export the path..is there a way to add this permanently to the PATH?

export PATH=/usr/bin:$PATH
share|improve this question

marked as duplicate by slhck Jan 17 '13 at 15:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Yes there is, but it depends on the shell you are using. E.g. for csh it might be set in .cshrc, for bash in .bashrc', or just in .profile`. Can you add which shell you use to the post? –  Hennes Jan 17 '13 at 14:51
    
@ Hennes - am using bash –  user184692 Jan 17 '13 at 14:54

1 Answer 1

When you log in and start bash as a login shell (bash -l) these scripts will be read:

System wide:

  • /etc/profile
    (This one should be shell independent, since it may also be called from ksh, sh, etc etc).
  • /etc/bashrc/

Personal:

  • ~/.profile
  • ~/.bash_profile (this one might actually source the .bashrc file)
  • ~/.bashrc

Decide if you want to make system wide, or user only changes. Then look for these files and select one of them. Add the path changes and start a new shell. Test. If it does not work, close the shell (with logout or Controld) and correct the typo.

Note that I did not write 'log out and start a new shell'.

share|improve this answer
    
Bash (at least when invoked interactively) looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and only sources the first when found, skipping the others. ~/.bashrc is only called for non-interactive startup (but for terminals on most *nix systems). See also: joshstaiger.org/archives/2005/07/bash_profile_vs.html –  slhck Jan 17 '13 at 15:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.