edit PATH linux
Open the terminal.
Use the
nano
orvim
text editor to open the shell configuration file. The file may be one of the following, depending on the shell used:- For Bash:
~/.bashrc
or~/.bash_profile
. - For Zsh:
~/.zshrc
. For Fish:
~/.config/fish/config.fish
.Navigate to the end of the file using the arrow keys.
Add the following line to append a directory to the PATH variable, replacing "/your/new/path" with the actual path you want to add:
bash export PATH=$PATH:/your/new/path
Save the changes and exit the text editor:
- For
nano
, pressCtrl + X
, then pressY
,