The Windows equivalents of the most used Linux commands

(techkettle.blogspot.com)

55 points | by elsadek 10 hours ago

16 comments

  • voidUpdate 16 minutes ago
    > "Author's note: From here on, the content is AI-generated"

    Ah, I see, googling the equivalent of "clear" was too much work and you had to get an LLM to do it for you. Well at least you were honest about it

  • not_a_bot_4sho 4 hours ago
    A great non-AI resource on this topic: https://ss64.com/
  • Akuehne 7 hours ago
    My most used windows command is, and will always be, `ls`.

    Then I'm reminded that it's not a know file or directory.

    • GoblinSlayer 13 minutes ago
      On one our linux machine filesystem became strange, probably because somebody mistyped `ls /bin` as `ln /bin`. I think docs say hardlinking folders is impossible or maybe /bin was a symlink.
    • IcyWindows 6 hours ago
      It's been nearly 20 years since powershell came out.
      • SoftTalker 5 hours ago
        And we had cygwin before that. First thing I always installed on a Windows box so I could use bash and all my favorite utilities.
      • moi2388 3 hours ago
        And it still sucks
    • gib444 1 hour ago
      Same! Closely followed by 'cat' lol. 'type' just doesn't register in my brain
  • hackyhacky 5 hours ago
    > Author's note: From here on, the content is AI-generated

    Kudos to the author for their honesty in admitting AI use, but this killed my interest in reading this. If you can use AI to generate this list, so can anyone. Why would I want to read AI slop?

    HN already discourages AI-generated comments. I hope we can extend that to include a prohibition on all AI-generated content.

    > Don't post generated comments or AI-edited comments. HN is for conversation between humans.

    • rmunn 5 hours ago
      If the author had also included a note explaining that he'd *reviewed* what the AI produced and checked it for correctness, I would be willing to trust the list. As it is, how do I know the `netstat` invocation is correct, and not an AI hallucination? I'll have to check it myself, obviating most of the usefulness of the list. The only reason such a list is useful is if you can trust it without checking.
      • tobyhinloopen 2 hours ago
        How would you know the invocation is correct when written by a human? Don’t humans make mistakes?
    • pjmlp 2 hours ago
      If I get that kind of content, my first reaction is to close it, it is kind of low effort content nowadays.

      Unfortunely at work it isn't as easy with all the KPIs related to taking advantage of AI to "improve" our work.

    • charcircuit 4 hours ago
      Why should you learn anything if you can just use AI to look it up? For fun is one reason.
  • malbs 6 hours ago
    findstr is an underappreciated command line tool. I use it a lot
  • flexagoon 3 hours ago
    > Finding a specific file by name across the system

    > Linux: find / -name "config.txt"

    This is not how you find a file across the entire system, you use plocate for that. find would take ages to do what plocate does instantly

    • Nux 3 hours ago
      Yes and no, with `find` I know I'm getting "live" results from the filesystem, whereas plocate (and s/locate) merely searches through a database updated god knows when, assuming it's even installed and the bulk of the files indexed.
    • gib444 1 hour ago
      No. "Slower" is not the same as "different functionality".

      In fact, "find" is guaranteed to be more correct. And more widely available.

  • red_admiral 45 minutes ago
    which / where is the one that always trips me up.
  • jmclnx 7 hours ago
    Not bad, but one big criticism, never do a 'kill -9' first, that will stop the program from cleaning up after itself if killed using -9.

    Use one of these instead:

        -TERM   then wait, if not
        -INT    then wait, if not
        -HUP    then wait, if not
        -ABRT
    
    If you are sure all of these fail, then use -9 (-KILL). But assume the program has a major bug and try and find another program that will do the same task and use that instead.
    • adrianmonk 3 hours ago
      Maybe this logic should be built into the "kill" command (or some other standard command). Given that this is the right way, it shouldn't be more tedious than the wrong way!

      It could also monitor the target process and inform you immediately when it exits, saving you the trouble of using "ps" to confirm that the target is actually gone.

      • jolmg 1 hour ago
        Different programs may take different amounts of time to cleanup and close. To know if a signal failed takes human judgment or heuristic. A program receiving a signal is even able to show a confirmation dialog for the user to save stuff, etc. before closing.
      • eptcyka 1 hour ago
        Kill is not a command to kill processes, it is a misnomer. Kill is meant to send signals to processes.
    • chasil 1 hour ago
      HUP is usually sent to daemons to instruct them to reinitialize and reread their configuration files.

      Is it still passed when a terminal is disconnected? I understand a dial-up modem was involved in the original intended use.

    • BenjiWiebe 4 hours ago
      How often does plain 'kill <pid>' not work, but some other signal other than SIGKILL works?

      Usually the process is either working correctly and terminates when asked, or else not working correctly and needs to be KILLed.

      • chasil 1 hour ago
        It is possible to install a handler for most signals, and that handler can be configured to ignore the signal.

        Signal 9 cannot be ignored.

      • consp 2 hours ago
        Lots of commandline tools will hold on to dear life except for the sigkill. I often have this with running background tasks which get one of their threads in an infinite loop or wait state.
    • eptcyka 1 hour ago
      Never use `kill -9`, instead refer to the signal directly. 9 is not always the same signal on all platforms.
    • consp 2 hours ago
      This is article is likely LLM generated and it regurgitates as first go what the last resort should be. After seeing that command I stopped reading.
  • WaterRun 7 hours ago
    I recently had a similar idea. https://github.com/Water-Run/Cmdset
  • 8note 6 hours ago
    ok, but how do i get the only linux command i know?

    ctrl+r

    • usr1106 5 hours ago
      Works just fine in powershell. Avoid using command prompt and life is already a bit better
    • thunderbong 5 hours ago
      F7
  • srott 1 hour ago
    less or at least more?
  • themafia 5 hours ago
    > Windows: netstat -n -a | findstr "https" (//note the double quotes)

    netstat works perfectly fine on linux as well. If you're looking for https connections it's certainly far more efficient than 'lsof'.

    also if you use '-n' then you're not going to get service names translated, so that probably should be:

    netstat -n -a | find "443"

  • HDBaseT 4 hours ago
    traceroute vs tracert always catches me out.
  • jpease 7 hours ago
    CTRL-ALT-DEL?
  • tpoacher 1 hour ago
    Can we do a satirical thread here please? I'm curious what HN can come up with :D

    I'll start:

      Linux             : trash-empty 
      windows equivalent: format C:
    
      Linux             : sudo apt update && sudo apt upgrade
      Windows equivalent: shutdown /r
  • owlstuffing 2 hours ago
    Not having to run a mess of Linux commands to install software.