Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding path variable in wsl

enter image description here

I have added a path in bashrc, still, the command is not found. When tried in ubuntu it worked but not in WSL. Why this happen?.

export PATH=\wsl$\Ubuntu\usr\local\mbdyn\bin:$PATH

added same path in .bashrc

error: command not found

**Please see the attached image

like image 823
Jithinraj Avatar asked Feb 04 '26 14:02

Jithinraj


2 Answers

As you have been told, the forward slash to use is / and if you use the command

PATH="$PATH:/folder/subfolder/" 

that value will only last in the PATH for the duration of the session. To include a value in the PATH permanently, edit the .bashrc file from your home

$ sudo vim ~/.bashrc

you add at the end

export PATH="$PATH:/folder/subfolder/"

you save and you will have that value in the PATH in each session

like image 123
Andres Robles Avatar answered Feb 06 '26 02:02

Andres Robles


You will need to modify the PATH variable as follows:

PATH="$PATH:/usr/local/mbdyn/bin"
like image 36
Raman Sailopal Avatar answered Feb 06 '26 03:02

Raman Sailopal