disable
Disable shell builtins or other named elements
TLDR
Disable a shell builtin
SYNOPSIS
disable [-afmprs] [name ...]
DESCRIPTION
disable is a zsh builtin that prevents named elements from being used. When a builtin is disabled, the shell will search $PATH for an external command of the same name instead. This is useful for forcing the use of an external version of a command over the shell builtin, such as using an external echo or test instead of the builtin version.
Disabled elements can be re-enabled with the enable builtin.
PARAMETERS
-a
Disable aliases-f
Disable shell functions-m
Treat arguments as patterns for matching-p
Disable shell parameters (variables)-r
Disable reserved words-s
Disable suffix aliases (zsh)
CAVEATS
Only available in zsh. In bash, the equivalent functionality is provided by enable -n. Disabling critical builtins like cd or exit can make the shell difficult to use. The effect does not persist across shell sessions unless added to shell configuration files.
HISTORY
The concept of disabling builtins was introduced in bash with the enable -n syntax. Zsh provides the dedicated disable command as part of its more modular approach to shell configuration, extending the concept to functions, aliases, and reserved words.
