Fixing ‘enabled’ is not recognized as an internal or external command in AWS CLI (Git Bash on Windows)

When running AWS CLI commands in Git Bash on Windows, you may encounter this error:
'enabled' is not recognized as an internal or external command,
operable program or batch file.
This error is not related to EC2, IAM, permissions, or AWS services. It is caused by a shell environment conflict in Windows.
Why This Error Happens
The issue typically occurs when using AWS CLI v2 in Git Bash.
By default, AWS CLI v2 uses a pager to display command output. A pager is a program such as less that allows scrolling through long output.
On Windows systems, particularly when using Git Bash, the pager can conflict with the underlying Windows command interpreter. When this happens, parts of the pager configuration may be incorrectly interpreted as shell commands. That is why Windows attempts to execute the word enabled as if it were a command.
This results in the error message shown above.
The CLI itself is usually installed correctly. The issue is how output is being handled.
How to Verify the CLI Installation
Before applying fixes, confirm that AWS CLI is properly installed.
Check the version:
aws --version
Confirm the executable path:
which aws
If these commands return valid results, the CLI installation is not the problem.
Temporary Fix
Disable the AWS CLI pager for the current session:
export AWS_PAGER=""
Then re-run your command:
aws ec2 describe-instances
The command should execute normally without triggering the error.
Permanent Fix
To permanently disable the pager in Git Bash, add this line to your .bashrc file:
export AWS_PAGER=""
After saving the file, restart Git Bash or run:
source ~/.bashrc
This ensures AWS CLI will not attempt to use a pager in future sessions.
Alternative Fix: Disable Pager Per Command
You can also disable the pager on a per-command basis:
aws ec2 describe-instances --no-cli-pager
This avoids modifying environment variables.
Root Cause Summary
AWS CLI v2 uses a pager by default.
Git Bash on Windows can conflict with pager execution.
Windows interprets part of the pager configuration incorrectly.
The result is a misleading shell error unrelated to AWS services.
Conclusion
If you encounter the error:
'enabled' is not recognized as an internal or external command
while running AWS CLI commands in Git Bash, the issue is almost always related to the pager configuration. Disabling the pager resolves the problem immediately. This is an environment-level issue, not a cloud configuration issue.
About the author
- I'm Benedicta, a technical writer and frontend developer. I'll guide you through complex or simple programming concepts
Comments
Join the discussionNo comments yet. Be the first to comment.



