How to add a Windows path to the Windows Ubuntu Subsystem path

9

2

I have a folder in my F drive and I want the bash on Windows Ubuntu Subsystem to point to it. The Folder is

F:\Projects\Phrasal

I am not sure how to add the Phrasal directory to my Shell path in the Windows bash.

My Shell path is

jos@HOME:~$

In other words i would like to have all the files in the phrasal directory to be available in the HOME directory or copy the files into HOME directory

Josephine

Posted 2016-11-16T06:32:56.047

Reputation: 115

So do you want to add it to your PATH or do you want to navigate to that directory? – Seth – 2016-11-16T06:59:23.277

I want to add it to my shell path. – Josephine – 2016-11-16T07:00:48.613

Answers

4

First, I don't understand what do you mean by Shell path. You said your Shell path is jos@HOME:~$. jos is your username and HOME is your computer name. ~ indicate home directory.

If you want to access your folder in F: drive then you can do this:

cd /mnt/f/Projects/Phrasal

This will navigate you to the folder you want. If you want to add it to your PATH then do this:

PATH=$PATH:~/mnt/f/Projects/Phrasal

PrashantKumar96

Posted 2016-11-16T06:32:56.047

Reputation: 136

I want the files in the phrasal directory to be available in the HOME directory – Josephine – 2016-11-16T08:44:53.887

To copy all the files from phrasal directory to your home directory: cp /mnt/f/Projects/Phrasal/* ~ -R – PrashantKumar96 – 2016-11-16T08:53:25.103

As an advanced solution (if you don't want to copy them over and over again from that location) you could use a symbolic link. ln -s /mnt/f/Projects/Phrasal/ Phrasal while being in ~. – Seth – 2016-11-16T12:39:00.433

6

To add lasting params to the $PATH in Ubuntu Bash for Windows 10 you first have to start the bash with the additional param "--login"

C:\Windows\System32\bash.exe ~ --login

Thanks to https://github.com/Microsoft/BashOnWindows/issues/219#issuecomment-294390862

After that you can edit your .profile

nano ~/.profile

There you can add a line at the last position:

PATH=$PATH:/new/path:another/path

Gordon Mohrin

Posted 2016-11-16T06:32:56.047

Reputation: 171