Skip to content

Making Windows pretend to be Linux so you can paste ChatGPT commands without crying

Notifications You must be signed in to change notification settings

darki73/powergnu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

PowerGNU

"I use Arch btw" — someone who actually runs Windows

PowerGNU is a collection of 57 GNU/Linux commands reimplemented as native PowerShell functions. Born out of the frustration of every LLM on Earth assuming you run Linux.

The Problem

  1. You ask Claude/ChatGPT for help
  2. It says grep -r "error" /var/log | awk '{print $3}' | sort -u
  3. You're on Windows
  4. You open WSL
  5. WSL has different networking, different filesystem mounts, different everything
  6. You cry

The Solution

# Just paste whatever the AI told you
grep -r "error" ./logs | awk '{print $3}' | sort -u      # works
cat config.json | jq '.database.host'                     # works
sudo apt install ffmpeg                                    # ...works??
find . -name "*.log" -type f | xargs grep -l "ERROR"      # works
echo "hello world" | sed 's/world/PowerGNU/'               # works

What's Included

File & Directory

ls cat cp mv rm mkdir ln touch stat find du df realpath dirname basename mktemp

Text Processing

grep egrep fgrep sed awk sort uniq cut tr rev tac wc head tail

Data & Formats

jq base64 md5sum sha256sum

Networking

curl wget

Shell Utilities

pwd export printenv env which date sleep seq yes xargs tee watch less diff

Package Management

apt apt-get sudo

System Info

lsb_release neofetch free top

Installation

Clone or copy the Modules\PowerGNU folder into your PowerShell modules directory, then add one line to your profile:

# PowerShell 7:  ~\Documents\PowerShell\Modules\PowerGNU\
# PowerShell 5:  ~\Documents\WindowsPowerShell\Modules\PowerGNU\

# Add to your $PROFILE:
Import-Module PowerGNU -DisableNameChecking

Or just copy the included Microsoft.PowerShell_profile.ps1 which does exactly that.

Highlights

apt wraps winget

Because every LLM says apt install and you're tired of translating.

apt install ffmpeg          # winget install ffmpeg
apt search nodejs           # winget search nodejs
apt remove vlc              # winget uninstall vlc
apt update                  # winget upgrade --include-unknown
sudo apt upgrade -y         # winget upgrade --all (sudo is a no-op)

jq actually works

Lightweight but handles the common patterns LLMs suggest:

cat data.json | jq '.users[].name'
kubectl get pods -o json | jq '.items[] | select(.status.phase == "Running") | .metadata.name'
curl -s https://api.example.com | jq -r '.results[] | .id'

lsb_release -a

Distributor ID: PowerGNU/Windows
Description:    Windows 11 Pro 24H2 (Build 26100) running PowerGNU
Release:        10.0.26100
Codename:       Noble Nag

neofetch

        .--.         user@HOSTNAME
       |o_o |        OS:       Windows 11 Pro 24H2
       |:_/ |        Kernel:   10.0.26100.0
      //   \ \       Uptime:   3d 7h 42m
     (|     | )      Shell:    PowerShell 7.5 + PowerGNU
    /'\_   _/'\      Terminal: Windows Terminal
    \___)=(___/      Packages: 284 (winget)
                     CPU:      13th Gen Intel Core i9-13900K
                     GPU:      NVIDIA GeForce RTX 4090 (24GB)
    PowerGNU on      Memory:   64GB
     Windows

free and top

free -h                    # memory usage, human-readable
top -b -n 10               # top 10 processes, batch mode
top -o MEM                 # sort by memory instead of CPU

Yes, the codenames are intentional:

Windows Codename Why
25H2 Panicking Penguin Tux woke up on the wrong OS
24H2 Noble Nag It keeps nagging about Microsoft accounts
23H2 Mantic Minotaur Stolen from Ubuntu
22H2 Jammy Jellyfish Also stolen
Other Cursed Chimera A chimera of Linux and Windows

Limitations

  • awk supports column extraction, -F, BEGIN/END, NR, simple conditions. It is not a full programming language. If an LLM gives you a 20-line awk script, you have bigger problems.
  • sed supports s/pattern/replacement/flags. Not the hold buffer. Not branching. Not Turing completeness.
  • jq covers .field, .[], pipes, select(), map(), keys, length. Not reduce, def, or a PhD thesis.
  • Pipes pass PowerShell strings, not raw byte streams. This matters approximately never for LLM-suggested commands.
  • ln -s requires admin on Windows. Blame Microsoft.
  • sudo is a no-op. It just runs the command. Windows has its own elevation model and we're not fighting it.

Why Not Just Install Real GNU Utils?

You could install Git Bash, MSYS2, GnuWin32, or coreutils via scoop. But:

  • They fight with PowerShell — two shells, two pipe semantics
  • Path hell: C:\Users\foo vs /c/Users/foo
  • They don't integrate with PowerShell's pipeline
  • You end up context-switching between shells

PowerGNU lives inside PowerShell. Everything works in one shell with native Windows paths and networking.

FAQ

Q: Is this cursed?
A: Yes.

Q: Should I use this in production?
A: This is production. Your terminal is production.

Q: How Linux is my Windows now?
A: lsb_release -a and find out.

Q: What's next, systemctl?
A: Don't tempt us.

License

MIT — Do whatever you want. We already did.

About

Making Windows pretend to be Linux so you can paste ChatGPT commands without crying

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published