← 返回命令列表

Linux command

unsetopt 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Disable option

unsetopt [optionname]

Disable glob

unsetopt glob

Disable extended glob

unsetopt extendedglob

Show all options

unsetopt

说明

unsetopt is a zsh builtin that disables shell options, serving as the counterpart to setopt. It controls various aspects of zsh behavior including filename globbing, command correction, history handling, and prompt expansion. When called without arguments, unsetopt displays all options that are currently unset. Option names are case-insensitive and underscores in option names are ignored, so extendedglob, EXTENDED_GLOB, and ExtendedGlob all refer to the same option. Changes only affect the current shell session unless added to zsh configuration files like ~/.zshrc. This command is specific to zsh and has no equivalent in bash, which uses shopt -u for a similar purpose with different option names.

FAQ

What is the unsetopt command used for?

unsetopt is a zsh builtin that disables shell options, serving as the counterpart to setopt. It controls various aspects of zsh behavior including filename globbing, command correction, history handling, and prompt expansion. When called without arguments, unsetopt displays all options that are currently unset. Option names are case-insensitive and underscores in option names are ignored, so extendedglob, EXTENDED_GLOB, and ExtendedGlob all refer to the same option. Changes only affect the current shell session unless added to zsh configuration files like ~/.zshrc. This command is specific to zsh and has no equivalent in bash, which uses shopt -u for a similar purpose with different option names.

How do I run a basic unsetopt example?

Run `unsetopt [optionname]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more unsetopt examples?

This page includes 4 examples for unsetopt, plus related commands for nearby Linux tasks.