this post was submitted on 26 Aug 2023
1504 points (97.5% liked)

Programmer Humor

19725 readers
57 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 67 points 1 year ago (4 children)

As of Aug 26, 2023, Windows command prompt absolutely does not recognize “ls” as a command.

Powershell is a different story.

Source: I type “ls” 40 times a day into a command prompt on my up-to-date win10 PC at work.

[–] [email protected] 7 points 1 year ago* (last edited 1 year ago) (2 children)

I literally just typed it into cmd.exe on Windows 10, fully updated, and it absolutely did work. No idea why it doesn’t work for you.

edit: ???

edit: it's been traced back to this:

https://github.com/devkitPro/installer/releases

which is an emulator toolset that I didn't know existed on my system until today.

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago) (2 children)

That is interesting. I just remoted into 5 different machines at the office and none of them worked with ‘ls’. If you enter ‘ls /?’, does it give you a synopsis and argument list?

[–] [email protected] 4 points 1 year ago (1 children)

Mystery solved, ls works for me due to this:

https://github.com/devkitPro/installer/releases

which is a toolset that was installed by an emulator package somewhere along the line, I just didn't know it was there.

[–] [email protected] 2 points 1 year ago

Thanks for letting us know!

[–] [email protected] 1 points 1 year ago

If I do “ls /?” it returns no such file or directory, but just “ls” performs exactly as you’d expect. I haven’t installed anything to provide that function that I know of. It never occurred to me that I would have to because as far as I know it’s always worked. Until today I just assumed it had become a standard command and never investigated. Was just happy I could use the same command in cmd and on my Pi box.

[–] [email protected] 2 points 1 year ago (2 children)

Out of curiosity what do you do to frequently end up with cmd? I don't think I've touched it in many years at this point.

[–] [email protected] 2 points 1 year ago

Lately I’ve been using it as a simple way to drag and drop a source .tar.xz archive on a .bat file so it can be twice extracted, moved, renamed, have dependencies downloaded by git, run a cmake process, do a visual studio compile, then move the result release directory back to where the .bat file is while removing unneeded files and adding new ones.

cmd and batch still has its uses.

[–] [email protected] 1 points 1 year ago

It’s my own fault, and the result of 30+ years of muscle memory building up. Plus, while I agree cmd isn’t nearly as powerful as powershell or wsl can be, when I’m in Windows it’s still the fastest way for me to do 90% of the simple things I need to do. I have a long history with it, and a thorough understanding of it, so I don’t really need to think for most of the things I’m doing there.

If I need to script something, or do anything that seems like it would be annoying to do in CMD, I hop into WSL pretty quickly and get to work with bash or python. The problem I have now is that I’ve developed a little muscle memory there as well… hence my issue with entering ‘ls’ everywhere.

[–] [email protected] -3 points 1 year ago (2 children)

I can't remember doing anything and "ls" works for me

[–] [email protected] 7 points 1 year ago (3 children)

Probably using Powershell, or you added it. Ls definitely doesn't work in windows 10 or 11 in cmd.

[–] [email protected] 1 points 1 year ago (1 children)

No it works in cmd. I didn't add it intentionally atleast. Never even tried to use it till now.

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)

Bone stock windows 11. It isn't, and has never been in cmd.

[–] [email protected] 1 points 1 year ago (1 children)
[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (2 children)

Bone stock windows 11. Like I have everyone else has said, you have done something to add it to cmd. It isn't, and has never been in cmd.

EDIT:

Try this. in CMD type in

where LS

[–] [email protected] 4 points 1 year ago
E:\>where ls
f:\Git\usr\bin\ls.exe

Mystery solved

[–] [email protected] 1 points 1 year ago

Ok, getting past the dickish, completely unhelpful first part of your reply (as you can see in the comments, not EVERYONE was saying that), the second part helped me trace it back to this:

https://github.com/devkitPro/installer/releases

which is a toolset that I never intentionally installed, and was evidently added by an emulator package without me knowing where it was or what it did.

So thank you for (eventually) helping me find what it was, and now you and others know how to add it to cmd and don't have to complain about its absence.

[–] [email protected] 2 points 1 year ago

It works on Powershell but not with CMD.

That's a problem when using NeoVim on windows