3

I am newbie in Cygwin, In windows, command prompt I used Cd Desktop command to move to the Desktop but when I using this same command for Cygwin it shows the following error

-bash: cd: Desktop: No such file or directory

Why is this error showing? And how to go to the Desktop from Cygwin?

2
  • what is your current working path? type pwd
    – DRP
    Jan 16, 2018 at 16:25
  • I installed Cygwin on C drive and there is a Home folder in the Cygwin64 folder and that is the default path Jan 16, 2018 at 16:37

4 Answers 4

0

Because there is no directory named Desktop in your current directory. Linux have a little different philosophy, and you can't get to Desktop in this way from every place. You can get instead into home directory by typing cd ~ from every place and to root directory by typing cd / from every place -> you can think about it in that way, that Linux uses home directory instead of Desktop. Every other time you have to cd to absolute path (which starts with /) or relative path (which starts with ./ or with no character).

Example:

  1. You are in directory /home/ninja (you can get your current directory by typing pwd).
  2. You type ls. Console logs all directories which you can get into now by typing cd. E.g console logged: Download Documents Music, so you can type now cd Download to move there.
  3. Additionally no matter where you currently are, you can use cd / and cd ~

Try that. ;)

2
  • I can't understand it clearly plz give a example Jan 16, 2018 at 16:47
  • 1
    I don't think this answers the question. While this explains how you can navigate in cygwin, does not really tell you where exactly you can find your Desktop directory on your Windows filesystem. The answer by @Baldrickk is more accurate
    – Alchemist
    Nov 11, 2019 at 9:15
6

By default, your cygwin home directory is under C:\cygwin\home
Your Windows home directory is under C:\Users\

Cygwin doesn't use the same root path as Windows does. The path to a drive is:

\cygdrive\DRIVE_ID

where DRIVE_ID is the lowercase windows drive letter.

So your desktop is located at:

\cygdrive\c\Users\coding_ninza\Desktop

assuming of course that your username is coding_ninza and you have the usual C: drive.

cd \cygdrive\c\Users\coding_ninza\Desktop 

will get you to your Windows desktop from any other directory. You can of course use relative paths to navigate too.

1
  • Cygwin/POSIX uses forward slashes for paths, not back-slashes. I think cygwin permits either, because Windows, but forward would be more proper for a POSIX environment.
    – mrtumnus
    Nov 12, 2021 at 17:18
6

Very Simple, don't be confused type;

cd C:/Users/Your_Username/Desktop

And it takes you to that Directory as Simple as that.

Cygwin Output

Cygwin output

Enjoy>>>

3
  • 1
    It worked for me in Cygwin, have you tried it. My Version 2.004 (Latest) Apr 18, 2020 at 18:10
  • Ah, my bad then, sorry. Please edit your answer to explicitly add that, and some Cygwin output?
    – Arjan
    Apr 20, 2020 at 6:42
  • 2
    @Arjan Done it you can see Apr 20, 2020 at 19:56
0

Maybe this command can help you:

Open the cygwin shortcut on the desktop as an administrator.


endi@endi-PC ~ $ cd c:/

endi@endi-PC /cygdrive/c $ cd c:/xampp

endi@endi-PC /cygdrive/c/xampp $ cd c:/xampp/htdocs

endi@endi-PC /cygdrive/c/xampp/htdocs $


this is what I did to open the xampp / htdocs folder

1
  • Why would an unnecessarily complicated way to change to htdocs help to get to the Desktop?
    – RalfFriedl
    Dec 10, 2019 at 7:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .