← 返回命令列表

Linux command

noglob 命令

文本

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

常用示例

Install a package without shell expansion

noglob apt install linux-*

Pass a URL with special characters

noglob curl https://example.com/api?key=value&page=2

Run find without expanding glob patterns

noglob find . -name *.txt

Use with package managers

noglob pip install package[extra]

说明

noglob is a zsh precommand modifier that disables filename generation (globbing) for all words in the command that follows. When used, pattern matching characters like \*, ?, and ... are treated literally rather than being expanded to match filenames. This is useful when passing arguments that contain glob characters to commands without needing to quote each argument individually. Common use cases include URLs with query strings, package names with brackets, and commands where wildcard characters should be passed through verbatim. noglob must appear before any other precommand modifier, as it is interpreted immediately before any parsing is done.

FAQ

What is the noglob command used for?

noglob is a zsh precommand modifier that disables filename generation (globbing) for all words in the command that follows. When used, pattern matching characters like \*, ?, and ... are treated literally rather than being expanded to match filenames. This is useful when passing arguments that contain glob characters to commands without needing to quote each argument individually. Common use cases include URLs with query strings, package names with brackets, and commands where wildcard characters should be passed through verbatim. noglob must appear before any other precommand modifier, as it is interpreted immediately before any parsing is done.

How do I run a basic noglob example?

Run `noglob apt install linux-*` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more noglob examples?

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