Unix: Getting Export PATH to “Stick”

前端 未结 6 1612
长发绾君心
长发绾君心 2021-02-09 13:19

When setting the export path in Unix, example:

export PATH=$PATH: $EC2_HOME/bin

If I quit terminal and open it back up to continue working, I h

相关标签:
6条回答
  • 2021-02-09 13:56

    You need to find your profile file and put that line in there. Suppose you use bash, the profile files are .bashrc and .bash_profile, found in ~. These files will vary depending on which shell you use.

    0 讨论(0)
  • 2021-02-09 14:03

    You have to put those commands into one of the "autostart" files of your shell.

    For bash this would be .bashrc in your homedirectory (create it if necessary)

    0 讨论(0)
  • 2021-02-09 14:06

    add it to your .bashrc or another .bash startup file.

    0 讨论(0)
  • 2021-02-09 14:08

    Open ~/.bashrc. This file is loaded every time you start up a new shell (if you're using Bash, which most people are). If you're using a different shell, the file may have a different name, like ~/.shrc.

    Add the line you need to the bottom of the file:

    export PATH=$PATH:$EC2_HOME/bi
    

    Other info rolled up from elsewhere in the thread:

    There are multiple places to put this, depending on your shell and your needs. All of these files are in your home directory:

    For Bash:

    .bashrc (executed when you shart a shell)
    

    OR

    .bash_profile (executed when you log in)
    

    For csh and tcsh:

    .cshrc
    

    For sh and ksh:

    .profile
    
    0 讨论(0)
  • 2021-02-09 14:10

    ... and for ksh edit .profile.

    0 讨论(0)
  • 2021-02-09 14:19

    Add it to your .cshrc file (for csh and tcsh), .profile file (for sh and ksh), or .bash_profile file (for bash)

    0 讨论(0)
提交回复
热议问题