alt.hn

4/1/2026 at 10:25:14 PM

The Windows equivalents of the most used Linux commands

http://techkettle.blogspot.com/2026/04/the-windows-equivalents-of-most-used.html

by elsadek

4/2/2026 at 8:38:52 AM

> "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

by voidUpdate

4/2/2026 at 4:44:21 AM

A great non-AI resource on this topic: https://ss64.com/

by not_a_bot_4sho

4/2/2026 at 1:36:42 AM

My most used windows command is, and will always be, `ls`.

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

by Akuehne

4/2/2026 at 2:38:15 AM

It's been nearly 20 years since powershell came out.

by IcyWindows

4/2/2026 at 3:31:39 AM

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.

by SoftTalker

4/2/2026 at 5:49:35 AM

And it still sucks

by moi2388

4/2/2026 at 9:21:22 AM

Cygwin was so much work but you’re still stuck in windows.

by smackeyacky

4/2/2026 at 8:42:23 AM

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.

by GoblinSlayer

4/2/2026 at 7:03:27 AM

Same! Closely followed by 'cat' lol. 'type' just doesn't register in my brain

by gib444

4/2/2026 at 8:11:10 AM

Back before "type" we had "copy FILE CON".

by red_admiral

4/2/2026 at 9:12:20 AM

Can I just do a shout-out for UnxUtils [1]?

I've had it on every Windows computer I used at work since forever now, and it is extremely useful to be able to use things like `sed` and `gawk` (and even `make`) from the command prompt

[1] https://unxutils.sourceforge.net/

by wernsey

4/2/2026 at 9:20:13 AM

Yuck. Just install WSL and be done with it

by smackeyacky

4/2/2026 at 9:26:44 AM

Underrated secondary option: git bash. Lower setup overhead than full WSL, although it is slower if you need to work on a lot of files or spawn a lot of processes.

by pjc50

4/2/2026 at 9:55:20 AM

I guess you get git bash for free when you install git, which speaks legions about the pain of powershell

by smackeyacky

4/2/2026 at 9:48:55 AM

Also, Minc, MinC is not Cygwin. And, yes slower, but it might work even under XP.

by anthk

4/2/2026 at 9:30:58 AM

Let me present you my favorite, how do you figure out dirname, basename and filename in batch script?

    set filepath="C:\some path\having spaces.txt"

    for /F "delims=" %%i in (%filepath%) do set dirname="%%~dpi" 
    for /F "delims=" %%i in (%filepath%) do set filename="%%~nxi"
    for /F "delims=" %%i in (%filepath%) do set basename="%%~ni"

    echo %dirname%
    echo %filename%
    echo %basename%
It is just as intuitive as one would expect.

by Ciantic

4/2/2026 at 10:29:29 AM

  $file = Get-ChildItem "C:\some path\having spaces.txt"

  Write-Output $file.DirectoryName
  Write-Output $file.Name
  Write-Output $file.BaseName
Or if that's still to verbose:

  $file = gci "C:\some path\having spaces.txt"

  echo $file.DirectoryName
  echo $file.Name
  echo $file.BaseName

People should really get over their aversion against powershell.

by dahauns

4/2/2026 at 2:17:42 AM

findstr is an underappreciated command line tool. I use it a lot

by malbs

4/2/2026 at 2:57:33 AM

> 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.

by hackyhacky

4/2/2026 at 3:09:46 AM

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.

by rmunn

4/2/2026 at 5:58:47 AM

How would you know the invocation is correct when written by a human? Don’t humans make mistakes?

by tobyhinloopen

4/2/2026 at 6:42:56 AM

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.

by pjmlp

4/2/2026 at 3:59:43 AM

Why should you learn anything if you can just use AI to look it up? For fun is one reason.

by charcircuit

4/2/2026 at 8:58:17 AM

ridiculous...

Why this entry is in the top 30?

by Skywalker13

4/2/2026 at 9:11:23 AM

Why would you use CMD when Powershell exists?

by quanta-rs

4/2/2026 at 9:26:16 AM

Its very likely that its just because i have almost no experience with powershell meanwhile i have now ~4-5 years of dailying linux but i just find the powershell commands to be very cumbersome to use. They are wayyy to long and descriptive instead of just 2-4 letters, there are 500 different commands for very specific uses instead of 10 tools that you can use and combine todo almost everything and if i recall correctly (my memory might trick me here tho) the errors are far less readable at a first glance and fill the entire terminal for simple things. CMD meanwhile feels like bash.

Most of my issues with it are probably just skill issues tho since like i said i dont really use or know it alot so i am happy to be corrected :) I mean if every Windows Sysadmin tells me how great powershell is, i cant just assume that they all are wrong (Or maybe its just the only way todo something thats otherwise simple over the terminal on windows, idk)

by Grisu_FTP

4/2/2026 at 9:24:04 AM

Because powershell is weird and obtuse? Or because powershell works slightly different in the terminal va the powershell dev environment? Its a tool most of us use under duress rather than choice

by smackeyacky

4/2/2026 at 10:14:12 AM

I certainly won't argue that pwsh is even close to perfect, but...obtuse is just about the most unfitting description of powershell. It offers a level of structure and consistency that is - even with all its shortcomings - orders of magnitude above the wild west of the daily reality of the linux cli.

Just because it's the mess we are all intimately familiar with, doesn't make it less of a mess.

by dahauns

4/2/2026 at 5:20:32 AM

> 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

by flexagoon

4/2/2026 at 5:36:07 AM

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.

by Nux

4/2/2026 at 6:59:56 AM

No. "Slower" is not the same as "different functionality".

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

by gib444

4/2/2026 at 1:22:46 AM

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.

by jmclnx

4/2/2026 at 5:11:29 AM

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.

by adrianmonk

4/2/2026 at 7:33:34 AM

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.

by jolmg

4/2/2026 at 7:25:25 AM

Kill is not a command to kill processes, it is a misnomer. Kill is meant to send signals to processes.

by eptcyka

4/2/2026 at 10:01:27 AM

On a modern OS, doesn’t the kernel (eventually) take care of the cleanup anyways?

by trympet

4/2/2026 at 4:48:22 AM

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.

by BenjiWiebe

4/2/2026 at 6:43:18 AM

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.

by consp

4/2/2026 at 7:38:42 AM

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.

by chasil

4/2/2026 at 9:38:07 AM

I don't think of 9 as really being a signal to the process at all, more of an instruction to the OS kernel to terminate the process

by gottheUIblues

4/2/2026 at 7:36:04 AM

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.

by chasil

4/2/2026 at 7:24:51 AM

Never use `kill -9`, instead refer to the signal directly. 9 is not always the same signal on all platforms.

by eptcyka

4/2/2026 at 6:40:59 AM

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.

by consp

4/2/2026 at 2:04:12 AM

ok, but how do i get the only linux command i know?

ctrl+r

by 8note

4/2/2026 at 3:14:19 AM

Works just fine in powershell. Avoid using command prompt and life is already a bit better

by usr1106

4/2/2026 at 3:18:55 AM

F7

by thunderbong

4/2/2026 at 8:10:22 AM

which / where is the one that always trips me up.

by red_admiral

4/2/2026 at 7:45:36 AM

less or at least more?

by srott

4/2/2026 at 3:27:46 AM

> 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"

by themafia

4/2/2026 at 4:11:43 AM

traceroute vs tracert always catches me out.

by HDBaseT

4/2/2026 at 1:20:46 AM

CTRL-ALT-DEL?

by jpease

4/2/2026 at 7:28:31 AM

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

by tpoacher

4/2/2026 at 6:01:58 AM

Not having to run a mess of Linux commands to install software.

by owlstuffing