Skip to content

Instantly share code, notes, and snippets.

@wolfferine
Created August 24, 2026 07:58
Show Gist options
  • Select an option

  • Save wolfferine/281fc2783b397ee7c10f9f5ce2fee4b6 to your computer and use it in GitHub Desktop.

Select an option

Save wolfferine/281fc2783b397ee7c10f9f5ce2fee4b6 to your computer and use it in GitHub Desktop.
GAIS - what's the macos terminal command equivalent of the powershell command: ls variable:*;
The closest macOS Terminal (zsh/bash) equivalent to list all defined variables is the set command.
## 💻 The Commands
* set: Displays all shell variables and local variables.
* env: Displays only exported environment variables.
## 🔍 Key Differences
* PowerShell's variable:* lists built-in, user, and global variables.
* macOS set outputs both variables and shell functions.
* To see only names and values without functions, use:
set | grep -v '^[a-zA-Z0-9_]* ()'
Would you like to find a specific variable, or do you need help exporting a variable so other applications can see it?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment