6

I am using git bash for windows and I am trying to access my desktop. When I enter the command cd ~/desktop I get the following message:

bash: cd: /h//desktop: No such file or directory

What am i doing wrong?

See attached screenshot.enter image description here

Sam Rao
  • 4,361
  • 5
  • 19
  • 21
  • 1
    Possible duplicate of [Change drive in git bash for windows](https://stackoverflow.com/questions/38563826/change-drive-in-git-bash-for-windows) – Jade Cowan Aug 31 '17 at 01:26

4 Answers4

18

right click on the mouse when you are in desktop and choose Git Bash Here, then your present working path will be '~/Desktop/'

or if you just want to use 'cd' to change your working path,then maybe the first letter of 'desktop' should be capitalized. Which means:

$cd ~/Desktop
Hejun
  • 366
  • 2
  • 9
5

This worked for me.

'Desktop' is moved to 'OneDrive' in Windows.

cd ~/OneDrive/Desktop
Rohit K
  • 51
  • 1
  • 2
0

Another way to solve this problem is to know the present directory you are using pwd

Then check is desktop is among the directories in that present one use ls

If not, use cd ~ to get your home directory and from there too look is the desktop is there.

Typing desktop or Desktop doesn't stop you from getting to the desktop, the error is telling that desktop isn't among the directoryies in home location

-1

Use the following command:

cd ~

Then:

cd Desktop