빠른 참조

Zsh 치트시트: 히스토리 확장, 프로세스 치환 및 Globbing 수식어

Z shell (zsh) 핵심 퀵 가이드: 명령어 히스토리 확장 문법, 프로세스 치환, 고급 globbing 파일 패턴 매칭 및 셸 환경 설정.

· 게시일

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.

관련 주제