How to open Desktop directory from Cygwin?

2

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?

coding_ninza

Posted 2018-01-16T16:21:42.057

Reputation: 137

what is your current working path? type pwd – DRP – 2018-01-16T16:25:26.573

I installed Cygwin on C drive and there is a Home folder in the Cygwin64 folder and that is the default path – coding_ninza – 2018-01-16T16:37:46.917

Answers

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. ;)

Qback

Posted 2018-01-16T16:21:42.057

Reputation: 128

I can't understand it clearly plz give a example – coding_ninza – 2018-01-16T16:47:50.270

1I 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 – 2019-11-11T09:15:28.743

3

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.

Baldrickk

Posted 2018-01-16T16:21:42.057

Reputation: 521

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

Endi Hariadi

Posted 2018-01-16T16:21:42.057

Reputation: 1

Why would an unnecessarily complicated way to change to htdocs help to get to the Desktop? – RalfFriedl – 2019-12-10T07:07:36.240