์œ ๋‹‰์Šค/๋ฆฌ๋ˆ…์Šค ์…ธ์— ๋”ฐ๋ฅธ ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์„ค์ • ํŒŒ์ผ

๊ฐœ์š”


์œ ๋‹‰์Šค/๋ฆฌ๋ˆ…์Šค ์‹œ์Šคํ…œ์—์„œ ์‹œ์ž‘ ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ์ž‘๋™ํ•˜๋Š” ์ˆœ์„œ๋Š” ์…ธ์ด ๋กœ๊ทธ์ธ ์…ธ์ธ์ง€ ์•„๋‹Œ์ง€์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์ง‘๋‹ˆ๋‹ค.

์…ธ์ด ๋กœ๊ทธ์ธ ์…ธ๋กœ ์ž‘๋™ํ•˜๋Š” ๊ฒฝ์šฐ๋Š” telnet์ด๋‚˜ ssh ๋“ฑ์œผ๋กœ ๋กœ๊ทธ์ธํ•˜๋Š” ๊ฒฝ์šฐ, su - ๋ช…๋ น์œผ๋กœ ์‚ฌ์šฉ์ž ์ „ํ™˜์„ ํ•˜๋Š” ๊ฒฝ์šฐ์ž…๋‹ˆ๋‹ค.

๋กœ๊ทธ์ธ ์…ธ๋กœ ์ž‘๋™ํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ๋Š” vim ๋“ฑ์˜ ํŽธ์ง‘๊ธฐ ์‚ฌ์šฉ ๋„์ค‘ ์…ธ ๋ช…๋ น์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด ์…ธ์„ ์‹คํ–‰ํ•œ ๊ฒฝ์šฐ, '-' ํŒŒ๋ผ๋ฏธํ„ฐ ์—†์ด ๊ทธ๋ƒฅ 'su' ๋ช…๋ น๋งŒ์œผ๋กœ ์‚ฌ์šฉ์ž ์ „ํ™˜์„ ํ•˜๋Š” ๊ฒฝ์šฐ์ž…๋‹ˆ๋‹ค.

  • ์…ธ์„ ์‹คํ–‰ํ•  ๋•Œ '-l' ์˜ต์…˜์„ ์ฃผ์–ด ์‹คํ–‰ํ•˜๋ฉด ํ•ด๋‹น ์…ธ์ด ๋กœ๊ทธ์ธ ์…ธ๋กœ ์ž‘๋™ํ•˜๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค.
    ex) $ bash -l
  • Xterm์„ ์‹คํ–‰ํ•  ๋•Œ '-ls' ์˜ต์…˜์„ ์ฃผ์–ด ์‹คํ–‰ํ•˜๋ฉด Xterm ํ„ฐ๋ฏธ๋„ ๋‚ด์˜ ์…ธ์€ ๋กœ๊ทธ์ธ ์…ธ์ด ๋ฉ๋‹ˆ๋‹ค.

๋‚ด์šฉ


๋‹ค์Œ์€ ๋ฆฌ๋ˆ…์Šค ๋ฐ ์œ ๋‹‰์Šค(Solaris) ์—์„œ์˜ Shell ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์„ค์ •์— ๋Œ€ํ•œ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค.

C Shell

  • ์…ธ์ด ๋กœ๊ทธ์ธ์…ธ์ด ์•„๋‹Œ ๊ฒฝ์šฐ : ์‹œ์Šคํ…œ cshrc -> ์‚ฌ์šฉ์ž cshrc($HOME/.cshrc)
    (์‹œ์Šคํ…œ cshrc : Solaris์˜ ๊ฒฝ์šฐ /etc/cshrc, ๋ฆฌ๋ˆ…์Šค์˜ ๊ฒฝ์šฐ /etc/csh.cshrc)
  • ์…ธ์ด ๋กœ๊ทธ์ธ์…ธ์ธ ๊ฒฝ์šฐ : ์‹œ์Šคํ…œ cshrc -> ์‹œ์Šคํ…œ login -> ์‚ฌ์šฉ์ž cshrc -> ์‚ฌ์šฉ์ž login($HOME/.login)
    (์‹œ์Šคํ…œ login : Solaris๋Š” ์—†์Œ. ๋ฆฌ๋ˆ…์Šค /etc/csh.login)

Bash Shell

  • ์…ธ์ด ๋กœ๊ทธ์ธ์…ธ์ด ์•„๋‹Œ ๊ฒฝ์šฐ : $HOME/.bashrc
  • ์…ธ์ด ๋กœ๊ทธ์ธ์…ธ์ธ ๊ฒฝ์šฐ : /etc/profile -> $HOME/.bash_profile

๋ฆฌ๋ˆ…์Šค(๋ ˆ๋“œํ–‡ ๊ณ„์—ด)์˜ ๊ฒฝ์šฐ ์‹ค์ œ ์ž‘๋™ ์ˆœ์„œ:

  • ์…ธ์ด ๋กœ๊ทธ์ธ์…ธ์ด ์•„๋‹Œ ๊ฒฝ์šฐ: .bashrc(/etc/bashrc sourcing) -> /etc/bashrc
  • ์…ธ์ด ๋กœ๊ทธ์ธ์…ธ์ธ ๊ฒฝ์šฐ: /etc/profile -> $HOME/.bash_profile(.bashrc sourcing) -> .bashrc(/etc/bashrc sourcing) -> /etc/bashrc

Korn Shell & Bourne Shell

  • ์…ธ์ด ๋กœ๊ทธ์ธ์…ธ์ด ์•„๋‹Œ ๊ฒฝ์šฐ: ์—†๊ฑฐ๋‚˜ $HOME/.kshrc
    (์ตœ๊ทผ์˜ ๋ฆฌ๋ˆ…์Šค์˜ ksh๋Š” ์‚ฌ์šฉ์ž ํ™ˆ ๋””๋ ‰ํ† ๋ฆฌ์˜ .kshrc๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝํ–ฅ์ด ์žˆ์Œ.)
  • ์…ธ์ด ๋กœ๊ทธ์ธ์…ธ์ธ ๊ฒฝ์šฐ:/etc/profile -> $HOME/.profile

ZSH

  • ์…ธ์ด ๋กœ๊ทธ์ธ์…ธ์ด ์•„๋‹Œ ๊ฒฝ์šฐ: /etc/zsh/zshenv => .zshenv =>  /etc/zsh/zshrc => .zshrc
  • ์…ธ์ด ๋กœ๊ทธ์ธ์…ธ์ธ ๊ฒฝ์šฐ: /etc/zsh/zshenv => .zshenv => /etc/zsh/zprofile => .zprofile => /etc/zsh/zshrc => .zshrc => /etc/zsh/zlogin => .zlogin (๋กœ๊ทธ์•„์›ƒํ•  ๊ฒฝ์šฐ: zlogout => /etc/zsh/zlogout)

์š”์•ฝํ‘œ


์ธํ„ฐ๋ž™ํ‹ฐ๋ธŒ ์…ธ์ผ ๊ฒฝ์šฐ

๋กœ๊ทธ์ธ ์…ธ์ผ ๊ฒฝ์šฐ

C Shell(csh)์‹œ์Šคํ…œ cshrc1)

์‚ฌ์šฉ์ž cshrc($HOME/.cshrc)
์‹œ์Šคํ…œ cshrc

์‹œ์Šคํ…œ login2)

$HOME/.cshrc

์‚ฌ์šฉ์ž login($HOME/.login)
Bash Shell(bash)HOME/.bashrc/etc/profile

$HOME/.bash_profile
์ผ๋ถ€ ๋ฆฌ๋ˆ…์Šค์˜ ๊ฒฝ์šฐ ์‹ค์ œ ์ž‘๋™ ์ˆœ์„œ
.bashrc(sourcing /etc/bshrc)

/etc/bashrc
/etc/profile

$HOME/.bash_profile(.bashrc sourcing)

.bashrc(/etc/bashrc sourcing)

/etc/bashrc
Korn Shell(ksh)์—†์Œ ๋˜๋Š” ์‚ฌ์šฉ์ž .kshrc3)/etc/profile

$HOME/.profile
Bourne Shell(sh)์—†์Œ/etc/profile

$HOME/.profile
Z shell(zsh)/etc/zsh/zshenv

$HOME/.zshenv

/etc/zsh/zshrc

$HOME/.zshrc
/etc/zsh/zshenv

$HOME/.zshenv

/etc/zsh/zprofile

$HOME/.zprofile

/etc/zsh/zshrc

$HOME/.zshrc

/etc/zsh/zlogin

$HOME/.zlogin

$HOME/.zlogout

/etc/zsh/zlogout

1)System cshrc : Solaris์˜ ๊ฒฝ์šฐ /etc/cshrc, ๋ฆฌ๋ˆ…์Šค์ผ ๊ฒฝ์šฐ /etc/csh.cshrc.
2)System login : Solaris๋Š” ์—†์Œ. ๋ฆฌ๋ˆ…์Šค๋Š” /etc/csh.login์„ ์‚ฌ์šฉํ•จ.
3)์ตœ๊ทผ์˜ ๋ฆฌ๋ˆ…์Šค์˜ ksh๋Š” ์‚ฌ์šฉ์ž ํ™ˆ ๋””๋ ‰ํ† ๋ฆฌ์˜ .kshrc๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝํ–ฅ์ด ์žˆ์Œ.