Adding the GNU coreutils to the path
Although PowerShell Core has a rich command-line language, it's also nice to have the GNU coreutils at our disposal. The GNU coreutils are the typical Unix command-line tools such as ls
, grep
, awk
, and sort
. They are a succinct, popular way of processing data and files, especially on Linux and macOS:
The easiest way to install the GNU coreutils is to install Git, which bundles these coreutils. During installation, the installer asks whether you want to Use Git and optional Unix tools from the Command Prompt. Selecting that option will make these coreutils available to PowerShell.
Note
The GNU coreutils tools distributed with Git (from the MinGW project) have some issues when dealing with Unicode characters, especially in CJK locales. For quick and dirty processing of mostly Latin/English characters, it's fine; but for other...