Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
zsh- a shell for
humans

@juandebravo
First goal: this prompt
•

Is it a new shell? No… it’s been there
since 1990!

•

It’s newer than bash? Well… less than
a year (bash was born in 1...
How to install
# Debian/Ubuntu!
> sudo apt-get install zsh!
# Mac OS X!
> brew info zsh!
> brew install --disable-etcdir z...
Set as default shell

> chsh -s $(which zsh)
Nice autocompletion:
cd
Nice autocompletion:
git
Nice autocompletion:
ssh
Globbing
> mkdir connect{“-api”,"-backend","-commons"}!
> ls -l **/foo.java!
> ls **/*.py(.x)!
> ls -l */**(Lk+100)!
> vi ...
path expansion
path replacement
Spelling correction
Aliases

# Normal alias!
> alias ..=“cd ..”!
Aliases
# Global alias!
> alias -g gp=“| grep -i | grep -v grep”!
> ps -ef gp redis!
=> ps -ef | grep -i redis | grep -v g...
Aliases
# Suffix alias!
> alias -s md=“subl”!
> README.md!
=> subl README.md!
Prompt

PROMPT='$(machine_name) [%~]$(rvm_prompt_info)$(nvm_prompt_info)$
(python_prompt_info)$(hg_prompt_info)$(git_promp...
Prompt

python_prompt_info() {!
[ $VIRTUAL_ENV ] && echo " %{$fg[yellow]%}~`basename $VIRTUAL_ENV`%
{$reset_color%}”!
}
Right Prompt
RPROMPT='$(battery_charge) $(current_time)'
Libraries on top of
zsh
> oh-my-zsh: https://github.com/robbyrussell/
oh-my-zsh!
> Prezto: https://github.com/sorin-ionesc...
More cool stuff
http://fishshell.com/
Thanks!

Juan de Bravo!
@juandebravo!
DEVCON 2013
You’ve finished this document.
Download and read it offline.
Upcoming SlideShare
Vim Rocks!
Next
Upcoming SlideShare
Vim Rocks!
Next
Download to read offline and view in fullscreen.

Share

Zsh shell-for-humans

Download to read offline

ZSH, a shell for human lecture during Developers Conference 2013

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Zsh shell-for-humans

  1. 1. zsh- a shell for humans @juandebravo
  2. 2. First goal: this prompt
  3. 3. • Is it a new shell? No… it’s been there since 1990! • It’s newer than bash? Well… less than a year (bash was born in 1989)! • why has it become popular? Due to ohmy-zsh
  4. 4. How to install # Debian/Ubuntu! > sudo apt-get install zsh! # Mac OS X! > brew info zsh! > brew install --disable-etcdir zsh
  5. 5. Set as default shell > chsh -s $(which zsh)
  6. 6. Nice autocompletion: cd
  7. 7. Nice autocompletion: git
  8. 8. Nice autocompletion: ssh
  9. 9. Globbing > mkdir connect{“-api”,"-backend","-commons"}! > ls -l **/foo.java! > ls **/*.py(.x)! > ls -l */**(Lk+100)! > vi **/README.md!
  10. 10. path expansion
  11. 11. path replacement
  12. 12. Spelling correction
  13. 13. Aliases # Normal alias! > alias ..=“cd ..”!
  14. 14. Aliases # Global alias! > alias -g gp=“| grep -i | grep -v grep”! > ps -ef gp redis! => ps -ef | grep -i redis | grep -v grep!
  15. 15. Aliases # Suffix alias! > alias -s md=“subl”! > README.md! => subl README.md!
  16. 16. Prompt PROMPT='$(machine_name) [%~]$(rvm_prompt_info)$(nvm_prompt_info)$ (python_prompt_info)$(hg_prompt_info)$(git_prompt_info)%{$reset_color%}! %{$fg[red]%}$(prompt_char) %{$reset_color%}' python_prompt_info() {! [ $VIRTUAL_ENV ] && echo " %{$fg[yellow]%}~`basename $VIRTUAL_ENV`% {$reset_color%}”! }
  17. 17. Prompt python_prompt_info() {! [ $VIRTUAL_ENV ] && echo " %{$fg[yellow]%}~`basename $VIRTUAL_ENV`% {$reset_color%}”! }
  18. 18. Right Prompt RPROMPT='$(battery_charge) $(current_time)'
  19. 19. Libraries on top of zsh > oh-my-zsh: https://github.com/robbyrussell/ oh-my-zsh! > Prezto: https://github.com/sorin-ionescu/ prezto!
  20. 20. More cool stuff http://fishshell.com/
  21. 21. Thanks! Juan de Bravo! @juandebravo! DEVCON 2013
  • adkdev

    Aug. 3, 2018
  • mattnux

    Jul. 12, 2016
  • JudeKenKwofie

    Jun. 4, 2016
  • kaistizen

    Mar. 13, 2016
  • xingheng907

    Jun. 15, 2015
  • moqiancong

    Dec. 12, 2014
  • yarikponomarenko

    Jun. 19, 2014
  • terrywang

    Jun. 18, 2014

ZSH, a shell for human lecture during Developers Conference 2013

Views

Total views

3,368

On Slideshare

0

From embeds

0

Number of embeds

3

Actions

Downloads

27

Shares

0

Comments

0

Likes

8

×