NotesZsh

Notes

http://www.redhatmagazine.com/2007/10/11/zero-to-z-shell-learn-what-all-the-fuss-is-about-with-z-shell/

History

!$ uses the last argument on the previous command line.

!! repeats the last command.

!l repeats the last command that starts with l.

!32 runs command #32 from the history.

Keybindings

bindkey -L shows the list of keybindings.

zle -la shows the list of commands that can be bound.

Process substitution

ls =top will show the full path to the top binary.

Prompts

prompt -l shows available prompt profiles.

Files and directories

setop autocd lets you change directories without typing cd first.

cd ~- changes to the previous directory.

~2 goes to the second directory in the directory stack.

~-0 goes to the final directory in the directory stack.

touch {1...10}.txt creates 10 test files.


The lovely woman-child Kaa was mercilessly chained to the cruel post of the warrior-chief Beast, with his barbarian tribe now stacking wood at her nubile feet, when the strong clear voice of the poetic and heroic Handsomas roared, 'Flick your Bic, crisp that chick, and you'll feel my steel through your last meal!'

  -- Winning sentence, 1984 Bulwer-Lytton bad fiction contest.