How do I access my Windows Desktop directory from inside Windows Subsystem for Linux?
Solution 1
What you're actually looking for is /mnt/c/Users/huque/Desktop
. You can
ls /mnt/c/Users/huque/Desktop
to see what's in it, or
cd /mnt/c/Users/huque/Desktop
to actually be there. /mnt/c
maps in your C: drive from Windows and you can access all your files through there.
Solution 2
This simply means that there is no directory called "Desktop" in your home directory - nothing more or less. And /home/huque is not necessarily the same as c:\Users\huque.
Related videos on Youtube
Admin
Updated on September 18, 2022Comments
-
Admin over 1 year
I am using Ubuntu for my terminal. I am unable to access my Desktop and when I type "ls" nothing shows up. How do I log in via desktop environment in order to access my desktop files?
huque@RNB:~$ pwd /home/huque huque@RNB:~$ cd Desktop -bash: cd: Desktop: No such file or directory huque@RNB:~$ ls huque@RNB:~$
---EDIT 1---- In response to @WinEunuuchs2Unix's comment, this is what happens when I type apt list ubuntu-desktop:
huque@RNB:~$ apt list ubuntu-desktop Listing... Done ubuntu-desktop/bionic-updates 1.417.1 amd64 N: There is 1 additional version. Please use the '-a' switch to see it huque@RNB:~$ -a -a: command not found huque@RNB:~$
---EDIT 2---- In response to @l0b0's comment, here is a screenshot of my terminal and the desktop image behind it.
-
Admin almost 5 yearsI can see my Desktop and the files on my Desktop though through my normal computer interface. Why can I not see it through my terminal window?
-
Janka almost 5 yearsLooking at the screenshot, which seems to list the contents of the home directory of huque the most obvious thing which comes to mind is you are looking into the wrong user's home directory, or looking at the wrong computer.
-
Admin almost 5 yearswhen I use powershell I can access Desktop (c:\Users\huque\Desktop) but I'm trying to avoid powershell since it doesn't have bash.
-
terdon almost 5 years@AlyssaHuque the Desktop you see is your Windows Desktop, this has nothing to do with the Ubuntu Desktop. You don't have an Ubuntu Desktop and as far as I know, you can't have one within Windows. The Linux Subsystem you are using on Windows is a command line tool, it doesn't have any graphical interface.
-
dr_ almost 5 yearsThis is the correct answer. Additionally, note that while you can access Windows files from Linux (WSL) in this way, you shouldn't write or edit Linux files using Windows tools as this will likely corrupt them.
-
Michael Homer almost 5 years@dr01 If you are up to date, you can freely open and edit whatever files you like (start with
explorer.exe .
and go nuts), though line endings may still occasionally be a problem. It installs a 9p server and client. -
dr_ almost 5 yearsThanks for the update, I haven't been using WSL for a while. Relevant blog post: devblogs.microsoft.com/commandline/…