mirror of
https://github.com/onkelbeh/cheatsheets.git
synced 2025-10-16 07:28:25 +02:00
- Update some sheets which have very long sections - Remove `layout: 2017/sheet` (everything has the same layout now) - Remove outdated sheets
1.6 KiB
1.6 KiB
title, category
title | category |
---|---|
zsh | CLI |
Expressions
Expression | Example | Description |
---|---|---|
!! |
sudo !! |
Last command (sudo !! ) |
--- | --- | --- |
!* |
vim !* |
Last command's parameters (vim !* ) |
!^ |
Last command's first parameter | |
!$ |
Last command's last parameter | |
--- | --- | --- |
!?ls <tab> |
sudo !?mv <tab> |
Command and params of last ls command |
!?ls?:* <tab> |
Params of last ls command |
|
--- | --- | --- |
*(m0) |
rm *(m0) |
Last modified today |
*(m-4) |
Last modified <4 days ago | |
{: .-headers} |
Change default shell
chsh -s `which zsh`
Process Substitution
Expression | Example | Description |
---|---|---|
<(COMMAND) |
grep "needle" <(curl "https://haystack.io") |
Replace argument with named pipe/FIFO (read-only) with command output |
=(COMMAND) |
vim =(curl "https://haystack.io") |
Replace argument with file (writable) containing command output |
{: .-headers} |
Also see
Zsh is mostly compatible with Bash, so most everything in Bash's cheatsheet also applies.