Ȼ/01

Top / Ȼ / 01

Unix is multiuser system: ޥ桼ƥȤƤ unix

unix ϡʣοʹ֤ƱƱƥȤפ߷פ줿 OS Ǥꡤƥޥ桼ƥȤ. ƥǤϡ桼̤ꡤ桼ιư񸻤̤¤뤿λȤߤ. ޤֿʹ֤ǤϤʤ桼פѤŬڤʺȤ򤵤λȤߤ͡ʻȤƤ. unix Ǥϡ桼ϻϿ졤ˤäƥ򳫻ϤŬڤʥޥɤˤäƺȤԤʤȤǥλ롤ȤȤܤǤ. äƤ˴ؤơޤϺǤǽ餫ɬפȤʤ륢ȤѥɤȤäΤ󡤥ˤĤΤ.

Login:

unix ƥ˥桼ȤƥѤ򳫻Ϥ³. ˼֥ȡפФˤʤ³Ǥ. ̤ˡ桼̤뤿ˡ֥ȡפȡ֥ѥɡפϤ. Ūʼ³ˤϥˡ (ץȥ) ˤä͡ʷ. ޤunix ưƤޥľܥ󤹤¾˥ͥåȥ̤Ʊ󤹤뤳ȤǤ. ̾ϡ󤹤ꤷƤ֥פȤФץबư桼ϤäƤ.

Logout:

unix ƥǥ桼Ȥƥλ³. ˼֥פФˤʤ³Ǥ. ΥȤԤʤޤǤ unix ˥Ȥˤʤ. Ūʼ³Ϥޤ͡ʷꡤƥˤäưۤʤ뤿, ̤ΤΥƥ˥󤹤˥ȤˤĤƤΤäƤɬפ.

Account:

ƥΥ桼ȤƤθġ̾Τ򤤤֥ȡפ¾ ֥桼͡פʤɤȤФ. ᡼륢ɥ쥹ΰȤѤ뤳Ȥ¿.

Password: ѥ

桼Ǥ뤳Ȥ뤿̩ιդ֥ѥɡפǤ. 桼μ̤ݾڤʤǤ뤿ᡤѥɤϳ̤򤱤ͤФʤʤ. ΤᡤѥɤϤʤ٤ʣʤΤ侩. Ф䤹¬ˤΡפƻȤΤ褤. ޤޤѹΤ褤.

warning.png & Ȼ

  • 󤷤ޤʤΥȡ¾ͤʤ˺¤äƥѥɤѹꡤΥ᡼ɤꡤ̾ǥ᡼äꡤΥǡ⡤õ¾ˤ͡԰٤ǽȤʤ. ä˾ڵ򤬤ʤФϵäȤȤư. Τᡤ󤷤ޤʤΥ뤳ȤϤƤϤʤʤ. ޤ˥Ȥ褦դ٤Ǥ.
    դˡ¾ͤʤΥ줿ȤäƤ԰٤򤷤ƤϤʤʤ. ԰٤ϡ԰١פȤƶѷ׻ƥεǧꤵƤꡤȯФϸ˽ȳ.
  • ŤΤᡤȻ˥ǥץ쥤Ÿڤ褦.ְ㤨ƥԥ塼ȤŸڤäꤷʤ褦ˤ뤳.⤷ְ㤨ΤŸڤäƤޤä TA ʤɤ̤뤳.

warning.png ѥɤˤĤƤ

ѷ׻ƥΤ褦˥ޥ桼ƥǺǤٲ٤ϡ¾ͤ桼ˤʤꤹޤʤ褦ˡפȤǤ. ΤˤϡѥɤФˤФʤ褦ˤɬפ.

  • äơѥɤˡ֥פ뤳ȤФˤƤϤʤʤ.
  • ֥ϥå󥰡פȸäơѥɤϤͤθۤ˥˥䥭ܡɤ߸¾ͤΥѥɤꤹˡ.ʤ褦ˡκݤˤϼϤλ.
    ޤϥåƤȸ򤵤ʤ褦ˡ¾ͤ󤹤ѥɤѹƤݤϡŪ˴Τ¾˸ΤޥʡǤ.
    ¾ͤ󤷤褦ȤƤ˴򤽤ऱθ򤷤ʤȡۤäƤ֤󲥤ƤʸʤΤդ뤳.

Commands and Procedures to login/logout: 󡤥˴Ϣ륳ޥɤ³ˤĤ

ϥƥ˶ط뤿ᡤƥˤäƳĥ줿¤ääƤꤹ뤳Ȥ¿. Ϻ綵ѷ׻ƥǤƱͤǤꡤΤޤŬѤǤʤ̤¿ʤäƤ.

ޤϴä顤ȤȤǤǤϤʤ٤ŵŪİŪʤΤ⤹. ʤƥ˴ؤƤϱ֥Ҳ𤹤ݤ˾ܤ.

󡤥˴Ϣ륳ޥɡ³
ޥǽ (̤ξ)
(ά)Τμ³.
ƥץȥˤäƤʤۤʤ뤬̾ϥ󥽡˺¤аʤȤ¿.
ѤμפΡ֥פ򻲾ȤΤ.
logout, exit Ȥ.
⥷ƥˤäƤʤۤʤ.
(X ȤäƤ) ΥޥɤѤʤ.
ѤμפΡ֥פ򻲾.
μ¤˥ȤǤ褦ˡμ³˺ʤ褦ˤ뤳.
passwd,yppasswd ѥɤѹ.
id桼Ρ桼̾ȥ롼̾ӳֹɽ.
lastǶ󤷤桼ΥꥹȤɽ.
uptimeƥβƯ֡桼ʿ٤ɽ.
who, w, finger, whoami who: ï󤷤Ƥ뤫ɽ
w: 󤷤Ƥ桼ȤκƤɽ. CPU ξ狼.
finger: 桼Ĵ٤
whoami: ...
who am I: ï?
date, cal date: ɽ
cal: ɽ.
leaveΥʤ٤Τ餻
leave 1400 : 2ˤʤä鵢ʤȡȤ˻ꤹ.
ȡ 1:55 1:59, 2:00, 2:01, (1ʬǤä) ˸Τ餻Ϥ.
leave +0015 : 15ʬ˵ʤȤȤ.

Basic of Command Operations: ޥδ

ơunix cui ԤȤȤϤɤȤ⤷Ƥ.

λȤߤˤĤƤϸҤ뤬cui Ǥϥԥ塼Фơ֥ޥɡפѤ᤹̿뤳ȤǹԤ.Υޥɤˤϡ礶äѤʸˡ¤Τǡ򤷤ƤȤ줫γؽ礤˽ˤʤ.ʲΥޥɤʸˡˤĤ.

Basic Grammer of Commands: ̿ (ޥ) δŪʸˡ

Ūʸˡϡ־ȤؤѸǤ̿פǤȻפɤ. Ūˤϡ

(̿ư) () (Ū)

¤٤̿ʸ롤ȻפФ褤. ºݤˤϡ

ޥ␣ץ␣

¤٤(֤ϥڡ␣Ƕڤ).

ץȤϡޥɤΡưѹä뤿ΤΡפǤꡤȤϡޥɤֺѤоݡפǤ.Ĥޤꡤޥɤ (̿ư) ץ () (Ū) ȻפФ褤.ץɤᤷϥޥɤ˰¸ΤǡҤ륪饤ޥ˥奢༡Ĵ٤ɬפ.̤˥ץˤ - (ϥե󡤥ޥʥ) ˤĤ봷㤬ΤǡΤäƤ褤.

Common Key Bindings: ޥǤ褯Ȥ륭

ޥɤ¹ԤѤѤΤǽꤿ褯ʬʤΤǻߤ᤿λˤɤɤʬʤȤȤ.Ϥȥޥ˥奢ɤǤ˽٤ޥ˥奢뤬̵Ѹɤʬʤξ⤢ΤǡϴȤƤ褯ѤƤ뼡Τ褦ʥϤƤߤȤ褤. ^ ϡCtrl򲡤ʤפ̣.

^c
¹Υޥɤߤ롤⤷ʤ.
^d.(ԥꥪ) + [Enter]
ޥɤϤƤȤϤϤ⤦פ̣뤳ȤǤ롤⤷ʤ.
ϤץפǤΤǡˤäƤϤΥϤǥ뼫ȤλƤޤΤդ뤳.
^g
ԽϤμ¹楳ޥɤߤ롤⤷ʤ.
^]
̿Ϥμ¹楳ޥɤü¹Ԥߤ롤⤷ʤ.

notes.png ƤپΤʤϰϤ, ˽ФƤޥɤƤߤơޥʷϵĤǤߤ. ŪˤϡμǹԤ. ʤμϤμȤǤμ½δܤʤΤǡüߥ졼ΰˤϴƤ٤.

  1. üߥ졼ư.
  2. ξǥޥɤ򥿥פ[Enter] 򲡤.
  3. 줿ȿߤƳؽ.
  4. ʲ֤.

warning.png kterm ϤȤüߥ졼ȤϡʸüȸƤФʸʤüΡ֥ߥ졼=ư諒եȥפΰǤ (kterm = Kanji TERMinal emulator). cui Ķδˤüߥ졼ϺǤڤʼʤǤΤǡ줫ɤѤ.Ʊͤʸüߥ졼ˤϡxterm, rvxt, gnomeüʤɿ¿ΤǡʬιߤΤΤȤȤ褤. ʤܳŪʡcui ĶˤĤƤ3μȤDz⤹.

Online Manuals: ּʬĴ٤뤿Ρץ饤ޥ˥奢

unix Ȥƥλʸˤϡֲ⼫ʬĴ٤פȤͤʬ.ΤᡤޥɤˤϴŪ˥饤Υޥ˥奢뤬ѰդƤꡤΥޥ˥奢򻲾Ȥ뤳ȤǻȤʤ褦ˤʤ뤳ȤԤ.ޤunix ΥޥɤĹˤγȯԤŤɲáɤƤΤʤΤǤ̾ȤץϤʤ㤦 (פ˥ХХ).̣Ǥ⡤ƥޥɤŪưξܺ١ץƼλ򥪥饤ޥ˥奢뤫ɤǤ桼ϥޥɤȤȤήפ unix cui ȤʤäƤ.

饤ޥ˥奢ǸΤϡ

  • ̾ : ̾Ȱ٤δñ.
  • : ץɤ¤٤뤫.
  • : 򤹤륳ޥɤʤΤβ⤪ӥץ.
  • : ΥޥɤˤޤĤ.
  • ĶѿեˤĤ.
  • : ñ. ǽ˸롤ȤΤ¤ɤ.
  • Ϣ: ط롤⤷ϻ褦ʥޥɤ.äõƤ뵡ǽȰ㤦ȤȤϤ褯ߤ.
  • Х : ХѾƤ.

ȤˤʤäƤ.

狼ʤäޤޥ˥奢롤ȤʤĤƤΤãؤǤ.(ܤϡunix ˾ܤƶƤοͤ򸫤ĤפǤ(^-^)).

Commands for Online Manuals: 饤ޥ˥奢˴Ϣ륳ޥɤ³ˤĤ

饤ޥ˥奢˴Ϣ륳ޥɡ³
ޥǽ
man␣ޥ̾饤ޥ˥奢.
ͿޥɤˤĤƤΥޥ˥奢ɽ.ꤷʤȡƤϱѸޥ˥奢.
jman␣ޥܸ̾쥪饤ޥ˥奢.
ͿޥɤˤĤƤΥޥ˥奢ܸɽ. ޥ˥奢ܸ¸ߤʤбѸΤΤɽ. ˤäƤϻȤʤ.
(j)man␣man饤ޥ˥奢Υޥ˥奢(^-^).
man ⥳ޥɤʤΤǡϥʤΤ. ޥ˥奢λȤˤĤƤ褯ʬʤϤ򸫤.
(j)man␣-k␣ޥ˥奢ǡ١椫饭ɤޤ褦ʤΤΥޥɤõФ󤹤.
ɤʬʤʴȤޥɤõꤹΤ˻Ȥ.
xmanXwindow Υ饤ޥ˥奢.
¸ߤޥ˥奢ꥹȤǸʤɡ빽ѸɽΤߤʤȤ¿.
info饤ޥ˥奢.
man Ǹޥ˥奢ϼˡ֥ƥԤˤäѰդ줿פΤǤ뤬info Ǥߤޥ˥奢ϥ桼ѰդΤǤ롤Ȥ㤤桼ߤȤ˰֤狼䤹㤤.
ˡ. ΥϥѡƥȤʤΤǡޤƤ˶Ϥʥޥ˥奢ȤʤĤӤˤ web document ȤƻȤ褦ˤʤäƤޤä.

warning.png (j)man ʤɤΥޥɤǥ饤ޥ˥奢̤˽ϤϤθɤä褤狼ʤ⤷ʤ. ¤ϡ̽ϤǤ̾ less ȤޥɤѤƤΤǡΥޥɤˡĴ٤ƤФ褤.Ūˤϡ(j)man lessʤɤȤ.

notes.png 饤ޥ˥奢륳ޥɤƤߤ. ˽ФƤ, ϢΥޥɤоݤȤƥޥ˥奢Ĵ٤ƤߤȤ褤.

Shell:

shell-image.png unix cui 򤷤褦Ȥȡ¤Ϥˤϡ֥פȤեȥ˵ưƤơʹ֤̿ (ޥ) ԤƤ. Ūˤϡkterm ưȤ

 >

 $

ʤɤȤɽǤ뤬ϥ뤬ֲϤƤפȥޥϤԤƤ뤳Ȥ򼨤Ƥ.

ŪˡΡ֥ץץ̤ƿʹ֤ʸϤ̿Ȥƥԥ塼Τunix Ǥ cui Ǥ.Ĥޤꡤunix os ȿʹ֤δ֤ˡ뤬äξζϤ򤷤ƤΤǤ.᡼ȤƤϡϡƱԡפ⤷Ͽʹ֤ΡּȤפȻפФ褤. ºݡϺ٤Ȥʹ֤˳ФƤƤ줿ꡤõʪ򤷤Ƥ줿ꡤְäޥɤľƤ줿ꡤȤޤˤ褯ǤȤȤäƤ褤.

ɡunix Ǥ cui ˴ȤΤϡȤǤ륷ؤ̿λ˴ȤȤǤȤ⤤.

ʤߤˡˤϤʼबꡤߤ˱ƹʤΤ֤ȤǤ.ʾξܤϥ륹ץȤؽȤ˹Ԥʤ.ơʳФƤ̿פˤȤϵդ¸ߤ. ϡunix cui Ǥˤϡ

  • оݥץ༫Ȥ

ȤĤΥեäƤΤǡĤΥե˴ؤμ׵ᤵ뤳ȡ꤬Ȥ (ä˽鿴Ԥ) 𤷤䤹ȤǤ.

ϡռƶ̤褦ˤƤФʬ褦ˤʤ.褯ʬʤȤϡʬäƤ븶ɤˤΤޤϤäꤵ褦ˤȲ褬ᤤ.

Variety in Shells: μ

Ͽ¿뤬礭ʬ [sh] [csh] ȤĤʬǤ.

sh
sh ȤǤ⥷ץ뤫ĸŤüȯΤǡ륹ץ (ñʥץ) Ȥߤ䤹ȿ̡ŪʬˤȤ.
csh
C ˻ʸˡѤ csh Ȥ뤫ϤޤΤǡŪˤϻȤ䤹륹ץȤǤ꤬䤹.

[sh] ŪΤ bash, [csh] ŪΤ tcsh ΤǡΤɤ餫ȤäƤɤ. ޤzsh Ȥ˶Ϥʥ¸ߤΤạ̇̄ΤϰĴ٤ƤΤ褤.

() ѷ׻ƥ sh ȾΤƤΤμΤ bash ǤΤ, sh εǽ¤Ƥ뤳Ȥδ񤷤(^-^).

Change of Shell: ΰѹ

ĤΥեȤǤΤǡ̤ΥޥɤȤƵưǤ. äơŪ˰ۤʤ륷ȤȤľ˥ޥɤȤϤФ褤. λ齪λޤǿξǺȤǤ.ȤäƤ륷λˤϡexit ޥɤȤ. ᡼ȤƤϡξǤ˥뤬ưȤ.

Change of Login Shell: 󥷥ѹ

󤹤ȼưŪˤ륷뤬桼Ѥ˵ưʹߥ桼 unix ƥζϤ򤹤.󥷥ȸƤ.󥷥ϥƥɸॷ椫鼫ʬιߤΤΤ򤷤ѹ뤳ȤǤ.ɸॷȤ /etc/shells ϿƤΤ򤤤. ѹˡˤĤƤϸҤ롥

Functions of Shell: εǽ

륹ץȤ˴ؤƤϸιֵDz⤹ΤǡǤϥŪѤ˴ؤԤʤ.ޤѥ˴ؤƤѴĶΥޥιֵǶ. ǽ˴ؤƤϡƼ亮ˤȤȤʤäꤹ뤦ޥɤۤʤ뤿ᡤܺ٤Ĵ٤ƤѤ褦.

Input of Commands: ޥɤ

ؤΥޥϤϡñ̤ǹԤʤ. ĤޤꡤܡɤϤʸϡǸ [Enter] 򲡤ȤǥΤǤ. ȡ[Enter] 򲡤ޤǤϤǤȤȤ.

Continuous Execution and Grouping of Commands: Ϣ³¹ԡgrouping

ޥϤδܤ 1Ԥ1ޥ Ǥ뤬Ϣ³륳ޥɤƱԤ³ƽ񤯤ȤǤ.Ūˤϡ

 ޥ; ޥ; 

ȥޥɤδ֤ ; (ߥ) 򶴤Ǥ褤.ȡΥҥȥ꡼ȤΤߤʤȤ. ޤϢ³¹Ԥ륳ޥɤ ( ) ǰĤΥ롼פˤޤȤ

 (ޥ; ޥ)

Ȥ뤳ȤǤ. 롼ײ줿ʣޥɤϥ뤫ϰĤΥޥɤȤưΤǡǤưѤäƤ.

History: ҥȥ꡼

ޤϤޥɤ (ꤷ) ФƤ뵡ǽ. Ʊޥɤ򥭡ܡɤǤĤꡤΤΥޥɤƤӽФ. Ȥ history ޥɤ ! Ϣ򸫤.

Edition of Command Lines: ޥɥ饤Խ

[Enter] 򲡤ʤ顤ϹԤŬԽǤ. ɤΥɤΤ褦˻Ȥ뤫ϥˤäưۤʤ뤬餯 emacs Хǥ󥰤ϻȤΤ¿.

Completion: 䴰

ޥ̾ե̾ϤƤ륭򲡤ǻĤʬ򥷥뤬äƤ뵡ǽǤ.б륳ޥɤե̾ĤʤϤ켫Τ䴰䤬ʣ϶ʬޤ䴰Ƥ.˥⤦ٲȰɽɽ줿ꤹ.

εǽϥˤäƤʤƯ㤦.Ρ֤륭פ [Tab] [Esc] , ^d ʤɤˤʤ (ˤäưۤʤ)ޤ [Tab] ƤߤΤɤ.

Alias: ̾

ʬǷ᤿ޥ̾ǰۤʤ륳ޥɤƤӽФȤǤ.ĤƱץĤƤޥɤĹΤûΤˤʬ䤹̾ˤʤɤ˾˱뵡ǽǤ.Ȥ alias ޥɤ򸫤.

Glob Expansion(Wildcard Characters): ե̾ (磻ɥŸ)

ޥбե̾졹ϤΤǤϤʤѥ򵭽Ҥ뤳Ȥdzեꤹ뤳ȤǤ.ʤΤǡȤȤʤ褦ˤʤ٤.

Υѥ뤿ʸȤϰʲ̤Ǥ.

  • ? Ǥդΰʸ
  • * Ǥʸ (0ʸʾ)
  • [] [ ] Τɤ줫ʸ. - ϰϻǤ.
  • {ʸ1, ʸ2,...} {} , Ƕڤ줿ɤ줫ʸ.

ե̾Ƭˤ . (ԥꥪ) . ľܻꤷʤȿʤΤդɬפ (㳰).

example of glob expansion: 磻ɥŸ

 > ls -Fa     man Ĵ٤Ƥ.

./ .a 00.c a.txt b z.txt

../ .b a abc dummy.html

 > echo ???   man Ĵ٤Ƥ.

abc

 > echo [a-c]*

a a.txt abc b

 > echo {a,z}.txt

a.txt z.txt

 > echo *.*     ˥ԥꥪɤΤ. ե̾Ƭ . ˤбʤ.

00.c a.txt dummy.html z.txt

 > echo *       ơ ȸե̾Ƭ . ˤбʤ.

00.c a a.txt abc b dummy.html z.txt

 > echo .* *    ơ ȸǥ쥯ȥ . .. ˤȿƤޤ.

. .. .a .b 00.c a a.txt abc b dummy.html z.txt

Commands about Shells: ˴Ϣ륳ޥɤ³ˤĤ

ʹߡܺ٤ man ޥɤĴ٤ΤǤ. ˺ʤ褦.

˴Ϣ륳ޥɡ³
ޥǽ
chsh, ypchsh 󥷥ѹ.
ɸॷ (/etc/shells) ˺ܤäƤ륷ιʤΤ˥󥷥ѹǤ.
alias␣̾=ޥޥɤ̾Ϳ.
Υޥɤ¹԰ʹߡꤷޥɤ̾ǸƤӽФȤǤ.
unalias␣̾̾.
historyޤǤ˼¹ԤޥɤꥹȤɽ.
ꥹȤĹˤ¤ΤǡΤˤϡľޤǤΥޥΰפǤ뤬
!!ľΥޥɹԤκƼ¹.
.
!n (nϿ)ޥꥹȤ n֤Υޥɹ.
ʤʤ.
!-n (nϿ)ߤ nΥޥɹ.
Ʊ.
ޥꥹ桤ʸƬˤ륳ޥɹԤǺǤǶΤ.
ȤƤ. ȤȤʤ.
!?ʸ?ޥꥹ桤ʸ󤬴ޤޤ륳ޥɹԤǺǤǶΤ
ʤΤ(ʹ֤) 㤤ư㤦ԤƤӽФƤޤȤΤǡȤȤդ򤹤٤
,, ^n, ^p ʤޥꥹȤľܥޥɥ饤ɽ.
̵ռ˻ȤäƤͤ¿.

notes.png ˽ФƤεǽޥİijΤƤߤ. ɤʬʤǰʤɤ֤󤢤顤ݤ϶ TA ˱θ̵ʹ.

Report: ݡ

ʲβˤĤơ긭ĴȹͻԤ
AppliedMath7-Report-01
Ȥ̾Ĥ e-mail ˤƶ˥ݡȤȤФ. ʤݡȤ e-mail TeX Ǻ̤ˤФƤ褤.

  1. (j)man␣-a ΰ̣Ĵ٤.
  2. cal Ѥơ10ǯμʬĴ٤.
  3. ls ΥץĴ١ʬǺǤ褤õɤɤΤ򵭽Ҥ. ޤalias Ѥ lsǤĤǤΥץƯ褦ˤƤߤ.
  4. ޥɥ饤Խ˻Ȥ륭Ĵ٤. (عԤعԤʸԤθޤǺ륭ԤƬ˹ԤԤκǸ˹Ԥ)
  5. ˵ְʳΡʥεǽʤĴ٤𤻤.
    # web Ĵ٤п¿Ĥ
  6. bash, tcsh, zsh ΰ㤤Ҥʤ web λȤĴ٤.ˡơΥºݤ˻ȤäƤߤơΰ㤤θơʬʤδۤ򵭤.





about Icons, ClipArts

For details, see JNorth_arrow-right-sm.png this.


źեե: fileshell-image.png 19 [ܺ]