11

On the new Bash on Ubuntu on Windows app on Windows 10, I tried to run ls from the starting directory to see the subdirectories but nothing comes up. I don't really know the directory structure so I'm not sure how to proceed next. What am I doing wrong here? I'm sure this is totally noob of me but I'm not sure what else to do.

1
  • 1
    ls / will list all root directories
    – Prometheus
    Apr 7 '19 at 14:06
10

it probably just means the folder is empty (or only contain hidden files). you can try ls -a (or ll) to see hidden files (including . and ..) and see that it works.

you can also try to create files and folders then rerun the command to see your created files and folders.

5
  • You're right. There are just hidden folders. How do I access all of my Windows folders from Bash on Ubuntu on Windows, then? Apr 16 '16 at 17:22
  • 7
    Your C drive is at /mnt/c/
    – Eran
    Apr 16 '16 at 17:43
  • 2
    cd ~ usually takes me to my user directory. In bash on windows this takes me to a directory empty except for things like .bashrc. It seems like there are some gotchas or caveats with mapping things. Aug 24 '16 at 18:39
  • 1
    It still takes you to your "home directory" on Windows' Bash, it's just that your home dir starts empty and it's disconnected from your Windows drive. Consider that it's like having a Linux machine with the Windows drive mounted as a secondary or network drive. But if you install Ubuntu stuff that go the "home dir" that will be where cd ~ takes you
    – Eran
    Aug 25 '16 at 3:48
  • if you want to list all directories in root. simply type ls /
    – Prometheus
    Apr 7 '19 at 14:06
0

When you see your Linux command prompt, type:

cd /mnt/c/Users/username

Where c means C: drive and username is your Windows username. Then, when you type ls, you will see folders like Desktop, Documents, Downloads, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.