9

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

  • So do you want to add it to your PATH or do you want to navigate to that directory? – Seth Nov 16 '16 at 6:59
  • I want to add it to my shell path. – Josephine Nov 16 '16 at 7:00
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
| improve this answer | |
  • I want the files in the phrasal directory to be available in the HOME directory – Josephine Nov 16 '16 at 8:44
  • To copy all the files from phrasal directory to your home directory: cp /mnt/f/Projects/Phrasal/* ~ -R – PrashantKumar96 Nov 16 '16 at 8:53
  • 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 Nov 16 '16 at 12:39
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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.