I recently installed the Ubuntu app in Windows and when I first installed it it was working fine but it won't let me change directory when I type in cd Desktop, or another cd command. It keeps sayin no such file or directory. Now I'm wondering if it's because I have the Ubuntu app installed but not the actual linux o.s and maybe the shell cannot see the desktop? Could that be it? Please bare with me I'm new to this.
62 Answers
When you want to change your directory with cd command, you should enter a path directory after cd:
cd your_path_directoryPath can be relative or absolute. In relative path you enter a path from where you are now. For example, if your terminal open in home directory you can easily go to Desktop with this commad:
cd Desktopbecause a Desktop directory is in your home but if you aren't in home you must enter a path apropriate for this situation. For example if you are in Downloads directory you should run:
cd ../DesktopYou can also use absolute path like this:
cd /home/yourusername/Desktopor replace /home/yourusername with ~:
cd ~/DesktopIf you want have a better understanding about it you can read the linux cammand line book. it has a complete explaination for path.
1WSL shells by default start in a directory that is different from your windows home directory. But WSL shells can see windows directories.
If your username is 'myname', you would cd /mnt/c/Users/myname/Desktop
If you just cd /mnt/c/Users/myname/ you will see your usual windows directories like Documents.