Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.mobile.android > #155382

Re: PSA: How to add WSL grep to the Windwos command-line PATH

From Paul <nospam@needed.invalid>
Newsgroups alt.comp.os.windows-10, comp.mobile.android, alt.msdos.batch, alt.os.linux
Subject Re: PSA: How to add WSL grep to the Windwos command-line PATH
Date 2026-08-28 15:37 -0400
Organization A noiseless patient Spider
Message-ID <116so1d$2ldf7$1@dont-email.me> (permalink)
References <116o67j$1uct$1@nnrp.usenet.blueworldhosting.com> <116osuj$1aaus$1@dont-email.me> <116ppii$1o35$1@nnrp.usenet.blueworldhosting.com> <116scp4$1rjh$1@nnrp.usenet.blueworldhosting.com>

Cross-posted to 4 groups.

Show all headers | View raw


On Fri, 8/28/2026 12:25 PM, Maria Sophia wrote:
> Maria Sophia wrote:
>> Then we need to add coreutils to the Windows path
>>  C:\> setx PATH "%PATH%;C:\Program Files\coreutils"
>>       SUCCESS: Specified value was saved.
> 
> WARNING!
> 
> Drat. That was a mistake!
>   C:\> echo %PATH%
>        Reports coreutils, then stuff, the same stuff, and coreutils again
> 
> That setx method was the wrong method, but worse, it wasn't even needed!
> 
> Since the purpose of this thread is to be a public service announcement to 
> help others run Linux commands like "grep" on the CLI, notethat the setx 
> above duplicated the path, and worse, the winget of coreutils added the 
> coreutils to the BEGINNING of the path, so, the end result was:
>   a. CoreUtils was in the beginning of the path
>   b. Then the old path was duplicated
>   c. And CoreUtils was added to the end of the path
> 
> So, the main advice here is to know that CoreUtils takes care of the path.
> 
> What comes now in this article is simply how to fix it if you did it.
>  1. Back up the path
>     reg export HKCU\Environment "%USERPROFILE%\path-backup.reg" /y
>  
>  2. De-duplicate the user path but still preserve the original order
>     powershell -NoProfile -Command "$u=[Environment]::GetEnvironmentVariable('Path','User') -split ';' | ? {$_}; $m=[Environment]::GetEnvironmentVariable('Path','Machine') -split ';' | ? {$_}; $u=$u | ? {$_ -notin $m} | Select-Object -Unique; [Environment]::SetEnvironmentVariable('Path',($u -join ';'),'User')"
> 
>  3. Remove the coreutils that was added at the end of the path
>     powershell -NoProfile -Command "$p=[Environment]::GetEnvironmentVariable('Path','User') -split ';' | ? { $_ -and $_ -ne 'C:\Program Files\coreutils' }; [Environment]::SetEnvironmentVariable('Path',($p -join ';'),'User')"
> 
>  4. Check the path
>     echo %PATH%
> 
> In summary, when you install the Microsoft CoreUtils, it appends the 
> coreutils to the path for you so you don't have to do it yourself.
> 

There are also things which can be loaded, which are not in the path.
Having a path fixation, is not entirely an answer. The Metro.App could
quite well have a couple designated storage areas. And there could be
registry recording of "viable" executables. The permissions on Metro.App
storage, do not allow easy examination, but you can use nfi.exe to list
stuff like that. Some things that execute on Windows, are being located
via registry location storage.

For a lot of people, the contents of their PATH will be a puzzle for them,
as it's not an area people look at much any more. And since there are
so many install methods, you really cannot be sure that a given installer
does the right things for the job. A WinGet of a GREP package, the gnuwin32 one,
does that work ? You'd have to test whether the installation process
even proceeded in a logical manner. It's different when you know a developer
provided an installer for the job of doing that.

Curation of facilities on Windows has degraded to the level of poop.
The poor bastard working on the loader. I don't even know if there
is an authoritative and logically written description of how everything
loads, or what gubbins are needed to load stuff. If this is evolution,
its knuckles are dragging on the ground again. Throwing an undocumented
(repositories...) WinGet into the mix, that's just a sloppy icing
for our poop cake.

So while it's great to write lines of Powershell to do this and that,
this is not "teaching a man to fish". This is "giving him a fish".
We don't have a reliable treatise useful for teaching a man to fish.
If I asked an LLM-Ai to do this, it is quite possible it would
forget a few methods. And as you "have to know the answer" to trust
an LLM-AI screed, there's no guarantee of good coverage of the topic.

I would hope Microsoft keeps internal documents on the topic, but
who really knows. Otherwise, how would a new employee become familiar
with the labyrinth. Asking the person in the cubicle next to you,
is not considered a good usage of their time. And asking Raymond,
Raymond is busy. He's already shoving shit that should have been
shoveled years ago.

This is one of the differences at Apple. Historically, they had
"Inside Macintosh". The format and presentation, is preserved
in TN (Technical Notes). Some of the notes are fantastically good.
I wrote a partition manager once for my Mac disk, and I could
do that using a *single* TN, didn't have to read anything else.
(This was after gparted impressed me by utterly destroying the partition table.)
When they choose to document something, it's not a half hearted
effort on their part. The efforts are usually "better than Wikipedia"
level of technical notes. The way someone might explain a thing
to you in a USENET post. Whereas the Microsoft documentation
is unimaginative "the boss is beating me with a stick to write
this description" flavored documentation, the best kind of
documentation when you really needed charitably written material.

   Paul

Back to comp.mobile.android | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-26 20:08 -0600
  Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 00:05 -0600
    Re: PSA: How to add WSL grep to the Windows command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-29 23:05 -0600
      Re: PSA: How to add WSL grep to the Windows command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-30 06:56 +0000
        Re: PSA: How to add WSL grep to the Windows command-line PATH Paul <nospam@needed.invalid> - 2026-08-30 05:26 -0400
          Re: PSA: How to add WSL grep to the Windows command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-30 08:23 -0600
          Re: PSA: How to add WSL grep to the Windows command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-30 23:31 +0000
    Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-30 20:53 -0600
      Re: PSA: How to add WSL grep to the Windwos command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-31 05:34 +0000
        Re: PSA: How to add WSL grep to the Windwos command-line PATH Frank Slootweg <this@ddress.is.invalid> - 2026-08-31 12:45 +0000
          Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-31 09:34 -0600
            Re: PSA: How to add WSL grep to the Windwos command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-31 22:28 +0000
              Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-31 21:33 -0600
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-09-01 07:31 +0000
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Arno Welzel <usenet@arnowelzel.de> - 2026-09-02 17:44 +0200
            Re: PSA: How to add WSL grep to the Windwos command-line PATH Arno Welzel <usenet@arnowelzel.de> - 2026-09-02 17:41 +0200
              Re: PSA: How to add WSL grep to the Windwos command-line PATH Paul <nospam@needed.invalid> - 2026-09-02 14:50 -0400
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Arno Welzel <usenet@arnowelzel.de> - 2026-09-02 22:00 +0200
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Richard Kettlewell <invalid@invalid.invalid> - 2026-09-02 21:16 +0100
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-09-02 23:42 +0300
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Paul <nospam@needed.invalid> - 2026-09-02 21:36 -0400
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Arno Welzel <usenet@arnowelzel.de> - 2026-09-04 18:37 +0200
              Re: PSA: How to add WSL grep to the Windwos command-line PATH Dan Purgert <dan@djph.net> - 2026-09-02 19:51 +0000
                Re: PSA: How to add WSL grep to the Windwos command-line PATH "Carlos E.R." <robin_listas@es.invalid> - 2026-09-02 22:05 +0200
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Dan Purgert <dan@djph.net> - 2026-09-02 20:25 +0000
                Re: PSA: How to add WSL grep to the Windwos command-line PATH CDB <bellemarecd@gmail.com> - 2026-09-02 22:39 +0200
    Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-30 21:03 -0600
  Re: PSA: How to add WSL grep to the Windwos command-line PATH Paul <nospam@needed.invalid> - 2026-08-27 04:36 -0400
    Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 10:45 -0600
      Re: PSA: How to add WSL grep to the Windwos command-line PATH Paul <nospam@needed.invalid> - 2026-08-27 14:44 -0400
        Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 12:59 -0600
          Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 13:16 -0600
        Re: PSA: How to add WSL grep to the Windwos command-line PATH Frank Slootweg <this@ddress.is.invalid> - 2026-08-27 19:41 +0000
          Re: PSA: How to add WSL grep to the Windwos command-line PATH vallor <vallor@vallor.earth> - 2026-08-27 20:03 +0000
            Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 19:18 -0600
              Re: PSA: How to add WSL grep to the Windwos command-line PATH Herbert Kleebauer <klee@unibwm.de> - 2026-08-28 12:13 +0200
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 09:51 -0600
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Herbert Kleebauer <klee@unibwm.de> - 2026-08-28 18:24 +0200
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 11:13 -0600
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Herbert Kleebauer <klee@unibwm.de> - 2026-08-28 19:36 +0200
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Frank Slootweg <this@ddress.is.invalid> - 2026-08-28 18:25 +0000
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 13:06 -0600
                Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 12:18 -0600
          Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 19:37 -0600
            Re: PSA: How to add WSL grep to the Windwos command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-28 04:28 +0000
              Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 10:46 -0600
        Re: PSA: How to add WSL grep to the Windows command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-28 01:21 +0000
          Re: PSA: How to add WSL grep to the Windows command-line PATH Paul <nospam@needed.invalid> - 2026-08-27 22:21 -0400
            Re: PSA: How to add WSL grep to the Windows command-line PATH Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-08-28 04:25 +0000
              Re: PSA: How to add WSL grep to the Windows command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-27 23:35 -0600
      Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-28 10:25 -0600
        Re: PSA: How to add WSL grep to the Windwos command-line PATH Paul <nospam@needed.invalid> - 2026-08-28 15:37 -0400
          Re: PSA: How to add WSL grep to the Windwos command-line PATH "Carlos E. R." <robin_listas@es.invalid> - 2026-08-29 13:16 +0200
            Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-29 16:27 -0600
  Re: PSA: How to add WSL grep to the Windwos command-line PATH Arno Welzel <usenet@arnowelzel.de> - 2026-08-30 12:58 +0200
    Re: PSA: How to add WSL grep to the Windwos command-line PATH "Kerr-Mudd, John" <admin@127.0.0.1> - 2026-08-30 12:48 +0100
      Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-30 08:23 -0600
  Re: PSA: How to add WSL grep to the Windwos command-line PATH Brian Gregory <void-invalid-dead-dontuse@email.invalid> - 2026-08-31 01:15 +0100
    Re: PSA: How to add WSL grep to the Windwos command-line PATH Maria Sophia <mariasophia@comprehension.com> - 2026-08-30 20:19 -0600

csiph-web