Why doesn’t the ‘ls’ command work when I try it on my computer or in the Codecademy terminal?
Answer
If your computer is running Windows, you’ll need to make sure you’re trying this command inside PowerShell. Otherwise, the command for Windows to do the same thing is dir.
If you’re trying the command in Codecademy’s environment and find it isn’t working as expected, make sure you’re typing it exactly as asked: ls. Note that Ls will not work – commands are case-sensitive! Any other variation will not work.
Thanks for the promptness. I realize that for PowerShell, I do not need to type the Shell Prompt ($) just the command “ls”. As soon as I did, it displayed a directory of my location…
One question @tbruck, so PowerShell is sufficient for taking this section of the course? I dont need a unix-based system?
You’re right, the prompt $ does not have to be typed in the command line.
Regarding your question, I am not sure, I am not associated with Codecademy, nor a frequent user of Windows-based systems, but from what I know Microsoft has tried to mimic basic bash functionalities in PowerShell, so I think you will be fine with what you learn in the course.
If you’re interested in how PowerShell and bash are different, here’s an article I’ve found that tries to compare PowerShell to bash:
Microsoft also seems to (plan to) implement bash on Windows 10,
Does it mmean that the Command Line course at Codecademy will not be helpful for windows users? I really want to learn and pratice it, I’m also a pyhton learner and a pro-member)) … what could you please recommend?
hello again, I decided to continue learning this chapiter “eventhough i was thinking comand lines in macs or *inux are != windows …” just to realise that the last point in the chapiter suggests “git gui” on windows with the same “comands” I’ve learned.
Thank Jesus !!! Thank you #Codecademy.
Actually, there are a bunch of different solutions. Git bash works, but windows 10 also has WSL (windows linux subsystem), given this was created with collaboration between microsoft and Canonical (company behind ubuntu, one of the most popular Linux distros), I would give WSL a try
I personally run a dual boot (two operating system installed along each other on the same machine), at boot you simply select the OS you want to run
‘ls’ does not work in windows it’s for Linux environment.
In windows command prompt ‘dir’ is used to get a directory view
Usage: dir
‘ls’ should work in Windows powershell though
Usage: ls