クイックリファレンス

Zsh 設定・履歴展開・プロセス置換・ワイルドカード修飾子早見表

Z shell(zsh)のクイックリファレンス:コマンド履歴の展開記法、プロセス置換、高度なファイル名グロブ修飾子、デフォルト設定。

· 公開日

History & Glob Expressions

Expression Example Description
!! sudo !! Re-run the previous command
!* vim !* All arguments from the previous command
!^ First argument from the previous command
!$ Last argument from the previous command
!?ls <tab> sudo !?mv <tab> Previous command matching ls and its arguments
!?ls?:* <tab> Arguments from previous command matching ls
*(m0) rm *(m0) Modified today
*(m-4) Modified within the last 4 days

Changing Default Shell

chsh -s $(which zsh)

Process Substitution

Expression Example Description
<(COMMAND) grep "needle" <(curl "https://haystack.io") Substitutes argument with a read-only FIFO / named pipe containing command output
=(COMMAND) vim =(curl "https://haystack.io") Substitutes argument with a writable temporary file containing command output

See Also

Zsh is largely backwards compatible with Bash, so most Bash commands and syntax apply directly.

関連テーマ