Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I open Cygwin, I want that I can see the Desktop -folder (I do not want to move its original location, I think the thing I want is hard-link with ln -cmd -- but not sure, this is my first idea to do it -- it is possible that there is some other way to do it, sorry I am now forgetting how do it in *ix boxes apparently -- I tried it the W-way by creating a shortcut but I messed up after cp-ing the files etc, not working). This is probably an easy puzzle, some clever ideas out there how to accomplish the goal to use the Desktop fast with Cygwin?

$ pwd
/home/hhh
$ mkdir Desktop
$ ln /cygdrive/c/Documents\ and\ Settings/hhh/Desktop/* Desktop
share|improve this question
    
The Windows Desktop isn't a physical directory. It's created by Explorer.EXE and can contain items from many different places. The user profile is just one source. –  MSalters Feb 16 '12 at 12:54
1  
@MSalters: It is both a physical directory and a virtual folder. The user profile is usually considered the primary source. –  grawity Feb 16 '12 at 13:47
    
@grawity: You might want to re-read the link you gave. It's indeed a virtual folder, but that does mean it cannot be a physical directory: a virtual folder is defined as a folder which isn't a physical directory. –  MSalters Feb 16 '12 at 13:54
add comment

3 Answers 3

You can use a symbolic link, but you have to create it to the Desktop directory itself, not to its contents.

rm -rf ~/Desktop
ln -s "/cygdrive/c/Documents and Settings/hhh/Desktop/" ~/Desktop

It will be accessible as ~/Desktop.

share|improve this answer
    
I cannot see the content of my Desktop (the thing I can see when Windows opens up) in the dir Desktop -- $ mkdir ~/Desktop; ln -s "/cygdrive/c/Documents and Settings/hhh/Desktop/" ~/Desktop. –  user114739 Feb 16 '12 at 21:22
add comment

I've always solved the problem by setting the Windows User environment variable HOME to be %USERPROFILE%. (%USERPROFILE% always maps to where the user's profile is stored, usually under "C:/Documents and Settings/".)

Cygwin respects HOME and wil make that the home directory for the user.

jwernerny@machine ~
$ pwd
/cygdrive/c/Documents and Settings/jwernerny

From there, Desktop is already a sub-directory.

BTW, Windows environment variables are set from the Advanced tab in the System Properties of the Control Panel in Windows up to XP. I'm not sure on later versions if it is still the same.

share|improve this answer
    
...could you give some cmd, I am lost what you mean. Sorry I am newbie with W, percentages? C:/ yes yes some paths but please use absolute paths...I see C:/ is some alias, ok...investigating. I am becoming ill to this, hard to even communicate precisely about W -- using some W mock-Pro 7 when the dev-branch is 6?! Inconsistence?! It would be cool if there was some optimized W available doing this kind of things automatically... –  user114739 Feb 16 '12 at 21:29
    
@hhh In windows, %var% is the same as writing $var in Un*x shell. See Wiki Article on Environment Variables for more on Windows and Un*x settings. From a command prompt, you would issue set HOME=%USERPROFILE% to set HOME to the folder above your Desktop. The problem is this only works as long as the cmd window is open. To make it permanent, you need to set it using the procedure in Setting Win7 Env variables. –  jwernerny Feb 17 '12 at 13:26
add comment

Well.. i know it's not quite what you are looking for but why don't you just create an alias like:

$ alias cdd="cd /cygdrive/c/Users/[your-username]/Desktop"

Then you could just type it in the command prompt to jump right in your Desktop folder like this

$ cdd

/cygdrive/c/Users/[your-username]/Desktop $

It's a good practice to save your aliases in your dotfiles which run at login, like ~/.bashrc for example. Doing so, will ensure you will have the cdd alias handy each time you login.

Hope it helps!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.