zshと仮想端末マネージャで快適ターミナル生活

 zshと仮想端末マネージャで快適ターミナル生活

D93fb300519f17800d3fbc8119ed4bed?s=128

Nobutoshi Ogata

September 12, 2011
Tweet

Transcript

  1. zshͱԾ૝୺຤ ϚωʔδϟͰ շదλʔϛφϧੜ׆ άϦʔגࣜձࣾ ։ൃຊ෦Πϯϑϥ౷ׅ෦ ඌܗ ெढ़ 11೥9݄12೔݄༵೔

  2. ΦϥΫϧͳ͏ 11೥9݄12೔݄༵೔

  3. About me ඌܗ ெढ़(͓͕ͨ ͷͿͱ͠) @nobu666 http://www.facebook.com/nobutoshi.ogata άϦʔגࣜձࣾ ։ൃຊ෦Πϯϑϥ౷ׅ෦ 2011/8/1ʙ

    ogata.nobu@gmail.com 11೥9݄12೔݄༵೔
  4. ͍··Ͱ΍ͬͯͨ͜ͱ ೔ຊΞϧΰϦζϜגࣜձࣾ डୗ։ൃ ҩྍܥ/ༀܥͷγεςϜ਺೥ χϑςΟגࣜձࣾʹ਺೥ɺNECϏοά ϩʔϒגࣜձࣾʹ2೥΄Ͳৗறͯ͠ɺ WebΞϓϦͷઃܭʙ։ൃʙӡ༻·Ͱ 11೥9݄12೔݄༵೔

  5. ͍·΍ͬͯΔ͜ͱ ήʔϜ͸࡞ͬͯ·ͤΜ ϝʔϧͱ͔ɺ಺੡ͷMySQL Proxyͱ ͔ɺͦͷลͷαʔϏεج൫Λ୲౰͢Δ νʔϜ શจݕࡧͷϦϓϨʔε͸͡Ί·ͨ͠ 11೥9݄12೔݄༵೔

  6. ͦΜͳΘ͚Ͱ λʔϛφϧͱ͸ ஥ྑ͠Ͱ͢ 11೥9݄12೔݄༵೔

  7. ͜ͷεϥΠυͷओࢫ zsh͜Θ͘ͳ͍Α!! Ծ૝୺຤Ϛωʔδϟ΋͜Θ͘ͳ͍Α!! ͜ͷ2఺͕͢΂ͯͳͷͰɺ͢Ͱʹ࢖͍ࠐ ΜͰ͍Δਓʹ͸෺଍Γͳ͍಺༰Ͱ͢ɻ ྃ͝ঝ͍ͩ͘͞ɻ 11೥9݄12೔݄༵೔

  8. ΞδΣϯμ zshɺscreenΛ࢖͍࢝Ί͖͔͚ͨͬ ศར͞ͷҰ୺Λ͝঺հ Ͱ΋ઃఆ͕໘౗ͳΜͰ͠ΐʁͳํ΁ ·ͱΊ 11೥9݄12೔݄༵೔

  9. zshͱscreenΛ ࢖͍࢝Ί͖͔͚ͨͬ 11೥9݄12೔݄༵೔

  10. Development Environment Conference 2006/9/9 5೥લ……ͩͱ…ʁ ड෇։͔࢝Β3෼Ͱຬһʹ http://b.hatena.ne.jp/t/decon zsh͸ίϐϖͰ࢖ͬͯ͸͍ͨ΋ͷͷɺ screen͸࢖ͬͯͳ͔ͬͨ 11೥9݄12೔݄༵೔

  11. DEConҎલ ɹ_______________________ ɹɹɹɹɹʻ◦√ɹɹͦͬ͘΋͏ͩΊ͔ɾɾ!! ɹɹɹɹɹ ͘͘ɹɹɹ࡞ۀ͢Δαʔόʔ͕ଟ͗͢Δ ɹɹɹɹɹ ը໘͕PuTTYͩΒ͚ʹ ͳͬͯ͠·͏ɾɾ!! 11೥9݄12೔݄༵೔

  12. DEConҎޙ ________________________________         ~|          \◦    େৎ෉͔ʁBOY            ∥\    <◦>     ∥/       ∥    /│     >>    \│ ɹ  screen͞Μʂʂ

    11೥9݄12೔݄༵೔
  13. screen Ծ૝୺຤ϚωʔδϟͷҰछ screen tscreen tmux byobu 11೥9݄12೔݄༵೔

  14. 11೥9݄12೔݄༵೔

  15. tmux!! ͣͬͱscreen೿Ͱ͕ͨ͠ɺࠓճͷεϥΠ υͷͨΊʹͪΐͬͱ࢖͍࢝ΊͨΒΑ ͔ͬͨ!! ͱ͍͏Θ͚Ͱվफ͠·͢ ʼʻ جຊతʹ͸ҰॹͰ͕͢ɺσϑΥϧτͰ ͦΕͬΆ͍ઃఆʹͳ͍ͬͯ·͢ 11೥9݄12೔݄༵೔

  16. screen/tmuxͷ ͏Ε͍͠ͱ͜Ζ 11೥9݄12೔݄༵೔

  17. Α͏ͧ͏͞Μͱ͔ͿΒͳ͍ൣғͰ ͳ͕Β࡞ۀ ෼ׂͯ͠ϩάΛݟͳ͕Β ͍ͭऴΘΔͷ͔Α͘Θ͔Βͳ͍όονͷىಈ σλονͯ͠ؼΔ ϩάΛ࢒ͤΔ ڭҭͷҰ؀ͱͯ͠࢖͑Δ ϚϧνΞλονϞʔυ 11೥9݄12೔݄༵೔

  18. zshͷ ͏Ε͍͠ͱ͜Ζ 11೥9݄12೔݄༵೔

  19. 11೥9݄12೔݄༵೔

  20. ཤྺͷ࢒Γํ͕͏Ε͍͠ ෳ਺ߦʹ౉ΔίϚϯυཤྺͷ࢒Γํ ͔͠΋ΤσΟλͷΑ͏ʹ్தΛॻ͖׵ ͑ͨΓͰ͖·͢ nobu666@cherub $ for n in 1

    2 3 for# do for# echo test; for# done test test test nobu666@cherub $(͜͜ͰC-p) nobu666@cherub $for n in 1 2 3 do echo test; done 11೥9݄12೔݄༵೔
  21. ࢉज़ԋࢉ͕͏Ε͍͠ nobu666@cherub $ zmodload -i zsh/mathfunc nobu666@cherub $ echo $((

    sin(1) )) 0.8414709848078965 nobu666@cherub $ echo $(( log10(2) )) 0.3010299956639812 nobu666@cherub $ echo $(( sqrt(2) )) 1.4142135623730951 nobu666@cherub $ repeat 3 echo $(( rand48() )) 0.9822596229634506 0.37442021252918423 0.13525322333015666 11೥9݄12೔݄༵೔
  22. ελοΫ͕͏Ε͍͠ ௕ͬͨΒ͍͠configureΦϓγϣϯॻ͍ ͯΔ్தʹɺ;͍ʹ --help ͕Έͨ͘ͳ Δ C-a C-kͯ͠configure --helpͯ͠C-y……? ESC-q

    Ͱ͓̺!! 11೥9݄12೔݄༵೔
  23. glob͕͏Ε͍͠ important.cҎ֎ͷ*.cΛফ͍ͨ͠ rm *.c~important.c *.txtҎ֎Λফ͍ͨ͠ rm *~*.txt find . -name

    ‘*.c’|xargs grep hoge grep hoge **/*.c 11೥9݄12೔݄༵೔
  24. άϩʔόϧΤΠϦΞε͕͏Ε͍͠ hogehoge | piyopiyo tail -f /var/log/php.log G Fatal ls

    -la L ޙΖʹύΠϓͰͭͳ͛ͯɺׂͱΑ͘࢖͏΋ͷ ͸શ෦ొ࿥ head,tail,grep,sort,uniq,lv,wc,sed,awk... 11೥9݄12೔݄༵೔
  25. ϚϧνϦμΠϨΫτ͕͏Ε͍͠ echo “test” > f1 >f2 echo “TEST” >file? <

    f1 <f2 < f1 > f3 11೥9݄12೔݄༵೔
  26. ϓϩηεஔ׵͕͏Ε͍͠ ͱࢥͬͨΒbashͰ΋Ͱ͖ΔΒ͘͠… (´ɾωɾʆ) paste <(hoge) <(moge) diff -u <(hoge|piyo) <(hoge|moge)

    αʔόʹtmpϑΝΠϧ࡞Γͨ͘ͳ͍ͱ͖ ͱ͔ʹͲ͏ͧ 11೥9݄12೔݄༵೔
  27. Ͱ΋ઃఆ͕ ΊΜͲͦ͘͞͏ 11೥9݄12೔݄༵೔

  28. ͦΜͳ͋ͳͨͷͨΊʹ zshͷ৔߹ oh-my-zsh https://github.com/robbyrussell/oh-my-zsh gitͰ͖࣋ͬͯͯthemeΛબΜͩΒɺͦΕͬΆ͍ ઃఆ͕͞Εͯ·͢ https://github.com/robbyrussell/oh-my-zsh/wiki/ themes 11೥9݄12೔݄༵೔

  29. ͦΜͳ͋ͳͨͷͨΊʹ(2) screenͷ৔߹ screen wrapper byobu tmux Ͳͬͪ΋σϑΥϧτͰɺͳΜ͔ͦΕͬ Ά͍ઃఆ͕ೖͬͯ·͢ 11೥9݄12೔݄༵೔

  30. DEMO 11೥9݄12೔݄༵೔

  31. ·ͱΊ ݹͷಓ۩͸ͱ͖ͬͭʹ͍͘ ͕ɺ֮͑Δͱڧྗ zsh΋ͦͦ͜͜ރΕ͖ͯͨ ૊Έ߹Θͤ ΦϨΦϨ؀ڥ 11೥9݄12೔݄༵೔

  32. άϦʔͰ͸ ٕज़ऀΛେืू ͍ͯ͠·͢ʼʻ 11೥9݄12೔݄༵೔

  33. ͝ਗ਼ௌ ͋Γ͕ͱ͏ ͍͟͝·ͨ͠ 11೥9݄12೔݄༵೔