The solution is that you are logged into the Bash shell as root. The beginning of the cursor line should say your username @ your computer name
not root @ your computer name
and the end of the cursor should have a $
not a #
. The root account doesn't have a Downloads directory which is why you are getting the error.
If this is the case you can type exit
and press enter this should bring you back to where it will have your username@yourcomputername and the $
at the end. If all else fails you can close Bash and open it again and it should start you in your user's 'home' directory.
Once set this way, typing cd ~/Downloads
(in Ubuntu/Linux it is case sensitive) will bring you into your Downloads directory. The Bash shell mirrors the Windows drive structure. The downloads folder is the same folder as Windows default download folder ... C:/Users/yourusername/Downloads
The original poster was having problems with the bash shell always using root. I have tried everything to get the initial screen back where you enter the Unix user name and password but wasn't able to find a way without breaking the shell.
The way I was able to get back to that initial setting was to create a new Windows account. Log into that account and then reboot
note I had to log in and let it set up the account then I had to reboot because some of the files needed for the bash didn't seem to be in place and it seemed to hang when I tried but the reboot solved that.
Then I launched a cmd prompt and type bash to get the following screen.
At this point I screwed up again... I picked the name Don for the UNIX name and put in a password .. everything worked well until I tried cd ~/Desktop
and it threw an error.
The error said
bash: cd: /home/don/Desktop: No such file or directory
If you notice in the image the user directory for this account I created is donat not don .. so the ~/Desktop is using the "username" to find the directory
Because of this I would have had to use donat as the Unix name for everything to work properly.
So if you have to create a new account to set this up properly .. Make sure you make note of what directory that new account is using and make that your UNIX login name matches the directory name.
As I said, if I look at explorer and look at the path C:\Users\ the "Home" folder is donat for this account.
Under further messing around I found that it seems that Windows and the Bash running in Windows doesn't like the ~/directory
shortcuts. You will have to use full paths such as /mnt/c/Users/username/Downloads
to access your download folder you can't just use ~/Downloads
.
ls
to see the files and tried to navigate that way ... maybe you are in the root directory and there is no Downloads folder there .. maybe its under /home/username .... but I can't be sure because like I say .. I have no way of checking and have never had the chance to play with the new bash in Windowsecho "$HOME"
? Bash substitutes any occurrence of~
at the beginning of what seems to be a path name with the value of the environment variable ofHOME
.