ÃֽŠ°Ô½Ã±Û(OS/WAS)
2020.05.29 / 12:08

macOS ±âº» Å͹̳Π°³¼±Çϱâ

Äڷγª

macOS ´Â À¯´Ð½º ±â¹ÝÀÇ OS ·Î °³¹ßÀ» ÇÏ´Ùº¸¸é Å͹̳ÎÀ» ¸¹ÀÌ »ç¿ëÇϱ⠸¶·ÃÀε¥ ±âº»À¸·Î Á¦°øµÇ´Â Å͹̳ÎÀº ³Ê¹« ºó¾àÇÕ´Ï´Ù. PuTTY °°Àº ´Ù¸¥ Å͹̳ΠŬ¶óÀ̾ðÆ®¸¦ »ç¿ëÇß´ø ºÐµéÀ̶ó¸é ´õ´õ¿í ±×·²°Å±¸¿ä. ±âº»ÀûÀÎ »ö±ò ±¸ºÐµµ ¾ÈµÇ¼­ »ç¿ëÀÌ ½±Áö ¾Ê¾Ò½À´Ï´Ù.

iTerm2 + zsh + oh my zsh

Å͹̳Π°ü·Ã ¶óÀ̺귯¸®µéÀ» ã´Ùº¸´Ï zsh ¶ó´Â ½©°ú Oh my zsh ¶ó´Â ÇÁ·¹ÀÓ¿öÅ© ±×¸®°í iTerm2 ¶ó´Â ¾ÖÇø®ÄÉÀ̼ÇÀ» Á¶ÇÕÇؼ­ ¸¹ÀÌµé »ç¿ëÇϽôõ¶ó±¸¿ä. ¾î¶² Á¡ÀÌ ÁÁ¾Æ¼­ »ç¿ëÇÏ´ÂÁö Çϳª¾¿ È®ÀÎÇغ¸°Ú½À´Ï´Ù.

Z shell (zsh)

ÀÏ´Ü ±âº» ½©ÀÎ bash ¸¦ ´ëüÇÒ¸¸ÇÑ ½©À» »ìÆ캸°Ú½À´Ï´Ù. zsh ´Â ±âÁ¸ bash, ksh, tcsh ÀÇ ÀϺΠ±â´É°ú À¯¿ëÇÑ ±â´ÉÀ» ´õÇÑ ½©ÀÔ´Ï´Ù.

Zsh is a shell designed for interactive use, although it is also a powerful scripting language. Many of the useful features of bash, ksh, and tcsh were incorporated into zsh; many original features were added.

zsh ¸¦ »ç¿ëÇϸ鼭 ´À³¥ ¼ö ÀÖ´Â ÀåÁ¡µéÀº ´ÙÀ½°ú °°½À´Ï´Ù.

  • ÄÁÅؽºÆ® ±â¹Ý ÀÚµ¿¿Ï¼º ±â´É (tab)
  • ´Ù¾çÇÏ°í ¿¹»Û Å׸¶¿Í Ç÷¯±×ÀÎ
  • ½ºÆ縵 üũ
  • history ±â´É

zsh ¼³Ä¡Çϱâ

±âº»ÀûÀ¸·Î zsh °¡ ¼³Ä¡µÇ¾î ÀÖ½À´Ï´Ù. ´ÙÀ½ ¸í·É¾î·Î ÇöÀç ¹öÀüÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.

1
2
$ zsh --version
zsh 5.3 (x86_64-apple-darwin17.5.0)

ÃֽŠ¹öÀüÀÌ ¾Æ´Ò °æ¿ì ´ÙÀ½ ¸í·É¾î·Î ¾÷±×·¹À̵å ÇØÁÙ ¼ö ÀÖ½À´Ï´Ù.

1
2
$ brew update
$ brew upgrade zsh

¾÷±×·¹À̵å ÈÄ Å͹̳ÎÀ» Àç½ÃÀÛÇغ¸¸é »õ·Î¿î ¹öÀüÀÌ Àû¿ëµÈ °ÍÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.

1
2
$ zsh --version
zsh 5.5.1 (x86_64-apple-darwin17.5.0)

±âº» shell º¯°æÇϱâ

ÇöÀç »ç¿ëÇÏ°í ÀÖ´Â ½©À» È®ÀÎÇغ¸°Ú½À´Ï´Ù.

1
2
$ echo $SHELL
/bin/bash

±âº»ÀûÀ¸·Î »ç¿ë°¡´ÉÇÑ ½©Àº ´ÙÀ½ ¸í·É¾î·Î È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.

1
cat /etc/shells

°á°ú¸¦ º¸½Ã¸é /bin/zsh ¶ó´Â °æ·Î¿¡ zsh °¡ ÀÌ¹Ì ¼³Ä¡µÇ¾îÀÖ´Â °É È®ÀÎÇÒ ¼ö Àִµ¥¿ä, ¿ì¸®°¡ brew ·Î »õ·Ó°Ô ¼³Ä¡ÇÑ ÃֽŠ¹öÀüÀ» µî·ÏÇØÁà¾ß ÇÕ´Ï´Ù.

1
2
3
4
5
6
7
8
9
10
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh

ÇöÀç zsh °æ·Î¸¦ È®ÀÎÇÏ°í /etc/shells ¸¦ ¿­¾î ¸Ç ¸¶Áö¸·¿¡ Ãß°¡ÇØÁÝ´Ï´Ù.

1
2
3
$ which zsh
/usr/local/bin/zsh
$ vi /etc/shells

±×·³ ´ÙÀ½ ¸í·É¾î·Î ±âº» ½©À» º¯°æÇÕ´Ï´Ù.

1
$ chsh -s `which zsh`

¸¸¾à /etc/shells¿¡ zsh °æ·Î¸¦ Ãß°¡ÇÏÁö ¾Ê¾Ò´Ù¸é ´ÙÀ½°ú °°Àº ¿¡·¯°¡ ¹ß»ýÇÕ´Ï´Ù.

1
chsh: /usr/local/bin/zsh: non-standard shell

Oh My Zsh

zsh ´Â ƯÈ÷³ª Oh my zsh ¸¦ ÀÌ¿ëÇؼ­ Å׸¶¿Í Ç÷¯±×ÀεéÀ» Àû¿ëÇÏ´Â °ÍÀÌ À¯¿ëÇÕ´Ï´Ù. zsh ÀÇ ±â´ÉÀ» È®Àå½ÃÄÑÁÖ°í Å׸¶¿Í Ç÷¯±×ÀÎÀ» »ç¿ëÇÒ ¼ö ÀÖµµ·Ï µµ¿ÍÁÖ´Â °ÍÀÌ Oh my zsh ÀÔ´Ï´Ù.

Oh-My-Zsh is an open source, community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes, and a few things that make you shout¡¦

oh my zsh ¼³Ä¡Çϱâ

´ÙÀ½ ¸í·É¾î¸¦ ÀÌ¿ëÇؼ­ ¼³Ä¡ÇÕ´Ï´Ù.

1
% sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

°­·ÂÇØÁø ÀÚµ¿¿Ï¼º tab

tab À» ÀÌ¿ëÇؼ­ ÀÚµ¿¿Ï¼º ±â´ÉÀ» ÀÌ¿ëÇϴµ¥ Á» ´õ ÆÄ¿öÇ®ÇÕ´Ï´Ù. tab À» ´©¸£¸é ¿É¼ÇÀ» º¸¿©ÁÖ°í Çѹø ´õ ÅÇÀ» ´©¸£¸é ¹æÇâÅ°¸¦ ÀÌ¿ëÇØ ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù.

1
2
% cd d
Developer/ data/ dev/

ÀÌ »Ó¸¸ ¾Æ´Ï¶ó °¢Á¾ ¸í·É¾îÀÇ ´Ù¾çÇÑ ¿É¼ÇµéÀ» º¸¿©ÁÝ´Ï´Ù.

1
2
3
4
% git r
rebase -- forward-port local commits to the updated upstream head
reset -- reset current HEAD to the specified state
rm -- remove files from the working tree and from the index

È÷½ºÅ丮

Æú´õ¸¦ À̵¿ÇÏ´Ùº¸¸é ¹Ù·Î ÀÌÀü Æú´õ·Î µ¹¾Æ°¡¾ßÇÒ ¶§°¡ ÀÖ½À´Ï´Ù. ±×·² ¶© ´ÙÀ½ ¸í·É¾î¸é ½±°Ô À̵¿ÇÒ ¼ö ÀÖ½À´Ï´Ù.

1
% cd -

±×·±µ¥ ÀÌÀüÀÇ ÀÌÀü Æú´õ·Î °¡·Á¸é ¾î¶»°Ô ÇؾßÇÒ±î¿ä? cd - »óÅ¿¡¼­ ÅÇÀ» ´©¸£¸é ¿©Å±îÁö À̵¿Çß´ø Æú´õÀÇ È÷½ºÅ丮¸¦ º¸¿©ÁÝ´Ï´Ù. ¼±ÅÃÇؼ­ À̵¿ÇÒ ¼ö ÀÖ½À´Ï´Ù (ÃÖ´ë 10°³). ¿¹½Ã¿¡¼­´Â Á» °£´ÜÇÑ Æú´õµéÀ̾úÁö¸¸ º¹ÀâÇÑ Æú´õ ±¸Á¶¸¦ ³Ñ³ªµé ¶§´Â ´õ À¯¿ëÇÕ´Ï´Ù.

1
2
3
4
5
6
% cd -
1 -- /dev
2 -- /Users
3 -- ~
4 -- ~/Dev/hexo/myBlog
5 -- ~/Dev

Spelling üũ

½ºÆ縵 üũ¸¦ ÀÌ¿ëÇؼ­ ¸í·É¾î¸¦ À߸øÄ£ °æ¿ì ¹Ù·ÎÀâ¾Æ ÁÙ ¼ö ÀÖ½À´Ï´Ù. ´ÙÀ½ ¸í·É¾î·Î ¿É¼ÇÀ» ÄÓ ¼ö ÀÖ½À´Ï´Ù.

1
% setopt correct
1
2
% gut add
zsh: correct 'gut' to 'git' [nyae]?

»óÀ§ Æú´õ·Î À̵¿Çϱâ

´ÙÀ½Àº bash ¿¡¼­ »óÀ§ Æú´õ·Î À̵¿ÇÏ´Â ¸í·É¾îÁÒ

1
$ cd ..

»óÀ§¿¡ »óÀ§, ±× »óÀ§±îÁö ¿Ã¶ó°¡·Á¸é Á» ±ÍÂú½À´Ï´Ù.

1
$ cd ../../..

oh my zsh ¿¡¼­´Â ´ÙÀ½°ú °°ÀÌ Á¡ÀÇ °¹¼ö¸¦ ÀÌ¿ëÇؼ­ À̵¿ÇÒ ·¹º§À» ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.

1
2
3
% cd ..   # ȗˤ
% cd ... # ȗˤ˂ ȗˤ
% cd .... # ȗˤ˂ ȗˤ˂ ȗˤ

Å׸¶ º¯°æÇϱâ

Å׸¶ ¿¡¼­ Å׸¶ÀÇ ½ºÅ©¸°¼¦À» È®ÀÎÇÏ°í ~/.zshrc ¸¦ ¿­°í Å׸¶¸íÀ» ÁöÁ¤ÇØÁÖ¸é Å׸¶¸¦ ¼³Á¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.

1
ZSH_THEME="robbyrussell" # ±âº» Å׸¶

¾î¶² Å׸¶µéÀÌ ÀÖ´ÂÁö ¸î °³ »ìÆ캼±î¿ä?

nebirhosnebirhos
daveverwerdaveverwer
af-magicaf-magic
eastwoodeastwood
kolokolo
mhmh

Å׸¶°¡ ³Ê¹« ¸¹¾Æ¼­ °í¸£±â ±ÍÂúÀ» ¶§´Â ÄÓ ¶§¸¶´Ù ·£´ýÀ¸·Î Å׸¶¸¦ ¹Ù²ãÁÙ ¼öµµ ÀÖ½À´Ï´Ù. Àú´Â ÀÌ°É »ç¿ëÇϴµ¥ Àç¹Õ³×¿ä.

1
ZSH_THEME="random"

±×·³ Å͹̳ÎÀ» ÄÓ ¶§¸¶´Ù ´ÙÀ½ ¸Þ½ÃÁö¿Í ÇÔ²² ·£´ýÀ¸·Î ¼±ÅÃµÈ Å׸¶°¡ Àû¿ëµË´Ï´Ù.

1
2
Last login: Wed May 30 20:33:02 on console
[oh-my-zsh] Random theme '/Users/fcreator/.oh-my-zsh/themes/sorin.zsh-theme' loaded...

Å׸¶ ±â´ÉÀÌ ÇÊ¿ä¾øÀ» ¶© ´ÙÀ½°ú °°ÀÌ Å׸¶ ±â´ÉÀ» ²ø ¼ö ÀÖ½À´Ï´Ù.

1
ZSH_THEME=""

iTerm2

iTerm2 ´Â ±âº» Å͹̳ο¡ ±â´ÉÀ» È®ÀåÇÑ ¹«·á ¾ÖÇø®ÄÉÀ̼ÇÀÔ´Ï´Ù. Àú °°Àº °æ¿ì´Â ±âº» Å͹̳ο¡ oh my zsh ¸é ÃæºÐÇؼ­ Àß »ç¿ëÇÏÁö ¾ÊÁö¸¸, ½©À» ¸¹ÀÌ »ç¿ëÇϽô ºÐµéÀ̶ó¸é À¯¿ëÇÏ½Ç °Í °°½À´Ï´Ù.

´Ù¿î·Îµå ÆäÀÌÁö

À¯¿ëÇÑ ´ÜÃàÅ°

Å͹̳Π°Ë»öÇϱâ

Command⌘ + f

°Ë»ö °á°ú¿¡¼­ Ž»öÇϱâ

Command⌘ + Shift⇧ + g

Àü¿ª °Ë»öÇϱâ

Command⌘ + Option⌥ + e

Ŭ¸³º¸µå À̷º¸±â

Command⌘ + Shift⇧ + h

ÅÇ ¿­±â

Command⌘ + t

ÅÇ Â÷·Ê·Î À̵¿

Ctrl + tab

ƯÁ¤ ÅÇ À̵¿ (ÅÇ ¹øÈ£)

Command⌘ + 1

â ¼¼·Î ºÐÇÒ

Command⌘ + d

â °¡·Î ºÐÇÒ

Command⌘ + Shift⇧ + d

È­¸é Æ÷Ä¿½º À̵¿

Command⌘ + [ ¶Ç´Â ]

ÇöÀç Æ÷Ä¿½º ã±â

Command⌘ + /

ÅÇ ´Ý±â

Command⌘ + w

ÀÌ»óÀ¸·Î ±âº» Å͹̳ÎÀ» ´ëüÇÒ ¼ö ÀÖ´Â ¹æ¹ýÀ» »ìÆìºÃ½À´Ï´Ù. ÀÌ ¿Ü¿¡µµ ÆùÆ®¸¦ ¸¶À½¿¡ µå´Â ÆùÆ®·Î ¹Ù²Ù´Â °Íµµ ÁÁ°Ú³×¿ä.