0

I am very new to all of this. I launch Git Bash in Windows 10. I type '''pwd'''. My home directory is '''/c/Users/ashle'''. When I type '''cd Desktop''', I receive '''bash: cd: Desktop: No such file or directory'''. How do I navigate to my Desktop? It must exist. Thanks!

mike
  • 1,233
  • 1
  • 15
  • 36
Alawler12
  • 5
  • 3
  • 1
    Did you try `cd /c/Users/ashle/Desktop` or `cd ~/Desktop`? – symlink Jun 29 '20 at 20:45
  • 1
    I noticed a similar question was posted. Does this help? [Change drive in git bash for windows](https://stackoverflow.com/questions/38563826/change-drive-in-git-bash-for-windows) – Riley Jun 29 '20 at 20:46
  • 1
    What does `pwd` return? – Paolo Jun 29 '20 at 20:48
  • @Riley it should, as the accepted answer explains opening Git Bash from the desktop context menu shows where the Desktop directory actually resides. In my case it's in `/c/Users/me/OneDrive/Desktop`. – CodeCaster Jun 29 '20 at 20:55
  • Here is a quick reference guide for unix commands https://www.tutorialspoint.com/unix/unix-useful-commands.htm. I don't know how many of them come with git bash. The following are super important for getting started: cd (change directory), ls (list), pwd (print working directory), mkdir (make directory), mv (move), rm (remove). Also ~ is an abbreviation for (what bash thinks is) your home directory. Bash and git come from Unix, where instead of having a special name for drives, your drives get mounted to folders. For compatibility, git bash will mount each drive to a folder somewhere. – Riley Jun 29 '20 at 21:02
  • `echo "$PATH"` should tell something maybe? – Jetchisel Jun 29 '20 at 21:27
  • 1
    Thank you @CodeCaster and Riley! I was able to find it and play around with it. Today is my first day. Lots to learn! – Alawler12 Jun 29 '20 at 21:30
  • Congrats on starting! That's exciting! If you find knowing some history helpful, there's a lot of info on unix history and the unix philosophy. That will definitely help you contextualize bash and how and why it differs from windows. But this is not necessary. – Riley Jun 29 '20 at 21:54

3 Answers3

0

lookup all the files/directories present under your current directory "c/Users/ashle" using 'ls' command. Check whether Desktop is present anywhere

Ps Naidu
  • 103
  • 1
  • 5
0
cd ~/OneDrive/Desktop

This works for me; my desktop seems to be in OneDrive

cd ~/Desktop

also works for some people

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
0

Right click on your Desktop, choose Open in Terminal, you will see the address of your Desktop. Then go back to Git Bash. If you can use the whole line, go for it. Otherwise, use cd to open each folder. Example:

$ cd c:
$ cd OneDrive
$ cd Desktop
Chau T.
  • 1
  • 1