跳到主要内容

PATH Settings

· 阅读需 1 分钟
大盗天放

How to add commands to $PATH in Linux or Mac?


What is PATH?

PATH is a variable in $ \star$nix system which tells the command path

Option1:Set PATH for your current shell session

export PATH=$PATH:/path/to/your/directory
  • Done

Option2:Change your PATH permanently

  • Edit your .bash_profile(if you ues Bash) or .zshrc( if using zsh)
  • add path at the end of the file
export PATH=$PATH:/path/to/your/directory
OR
export PATH=/path/to/your/directory:$PATH
  • Active your changes
source .bash_profile
OR
source .zshrc