Skip to content

Instantly share code, notes, and snippets.

@jpierson
Last active May 7, 2023 15:25
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jpierson/6053798e3c80c1e94c2ce5799c997df2 to your computer and use it in GitHub Desktop.
Save jpierson/6053798e3c80c1e94c2ce5799c997df2 to your computer and use it in GitHub Desktop.
Unix/Linux to Powershell Command Cheatsheet

Unix/Linux to Powershell Command Cheatsheet

This guide aims to document useful commands that I commonly see used in Linux and Unix environments to their closest equivalent in Powershell.

Command: wc

Use: Counts some aspect of the input stream and returns a summarized value as output.

Linux:

~# echo -n internationalization | wc -c
20

Powershell:

> echo internationalization | Measure-Object -Character

Lines Words Characters Property
----- ----- ---------- --------
                    20
*nix Powershell What it does
wc -l Measure-Object -Line Returns the line count
wc -c Measure-Object -Character Returns the character count
wc -w Measure-Object -Word Returns the word count

Resources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment