Bash on Ubuntu on Windows: ls command returns nothing at root level

6

1

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.

Sergei Wallace

Posted 2016-04-15T21:57:32.347

Reputation: 2 239

1ls / will list all root directories – Prometheus – 2019-04-07T14:06:37.977

Answers

9

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.

Eran

Posted 2016-04-15T21:57:32.347

Reputation: 3 201

You're right. There are just hidden folders. How do I access all of my Windows folders from Bash on Ubuntu on Windows, then? – Sergei Wallace – 2016-04-16T17:22:16.827

6Your C drive is at /mnt/c/ – Eran – 2016-04-16T17:43:52.747

2cd ~ 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. – jinglesthula – 2016-08-24T18:39:36.723

1It 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 – 2016-08-25T03:48:22.237

if you want to list all directories in root. simply type ls / – Prometheus – 2019-04-07T14:06:08.453