Ȼ/04

Top / Ȼ / 04

ޤǤκȤǤǤƤǰʤɤˤĤơ餿.
ʤޤǤκȤɤդƤʤȤΤϵޤɤդ.

줫κȴĶ

ʸü

Ȥꤢ GUI (X Ķ) Ȥ褦ˤʤäΤǡξ Terminal Emulator ѤΤʤˤǤ. äƤˡȤƻȤäƤȤˤ褦*1.

Gnome ξ硤ǥեȤǤϡ֥ץꥱע֥עüפȤȤȤꤢŪʸüߥ졼Ω夬ϤǤ.

  • ¾ˤ, 󥹥ȡ뤷Ƥ¿ͤʸüߥ졼(kterm rxvt ʤ)Ȥ.
    GNOME ü
    kterm &
    rxvt &
    ʤɤȤΩ夬뤫Ƥߤ褦(ȤäƤߤ󥹥ȡ뤵ƤʤȤʤ portinstall ǥ󥹥ȡ뤷褦).
    ȤäƤߤƤ餬äΤä顤˥塼Ȥ褦ˤƤΤ褤.

ʣΥ󥽡

FreeBSD ϵư夹ǤʣΥ󥽡뤬Ω夬äƤ. ᡼ȤƤϡ˥ȥܡɤʣҤäƤȻפФ褤.
ŪˤɤʤäƤ뤫ϡ

 less /etc/ttys

ȤƤߤ. 4ܤ "on" ˤʤäƤΤƤ륳󥽡ǤꡤǥեȤǤ ttyv0ttyv7 8椬ưƤΤʬ.

ºݤˤϥ˥/ܡɤȤҤäƤʤƤ⡤ʣΥ󥽡ڤؤƻȤȤʤˤǤ. ˤ Alt+F2 ʤɤȤФ褤*2. ʤߤˡX Ω夲Ƥ֤ Ctrl+Alt+F2 ʤɤȤʤȤʤ.

(½)

notes.png 嵭Υ󥽡ڤؤƤߤ褦. ơäƤߤ褦*3.

ǥ

Unix OS δδܤϥƥȷե򥨥ǥԽȤȡʸüǤΥޥϺȤǤ*4. ǡǥˤĤƤ⿨Ƥ.

Unix ǤΥǥϴŪ

  • Emacs (ܸ줬Ȥ䤹褦˥ѥåäƤΤ Emcws ȤФ)
  • Vi (¼ŪˤϡθѤܤ VIM Ȥ뤳Ȥ¿)

Τ줫ȤȤˤʤ(ͳ͡뤬).
warning.png emacs vi Ȥʤ unix cui ĶλȤʤ̵˶ᤤиơ줫Υǥˤʤ褦

桼󥿥եɤ⤯鿴Ԥˤϥĥ饤ΤΤǡUnix OS ¿Ͻ鿴Ѥ˶۵ŪʥǥѰդƤ.
ޤǤˤȤä褦ˡFreeBSD Ǥ "ee" ȤʰץǥѰդƤΤǡ鿴ԤϤ̾ФƤɤ

Unix Ǥ CLI ĶǤϡ¼Ū˥ȸƤФ륽եȥäƺȤԤ.
ΤᡤɤΤ褦ʥ֤ΤޤɤΤ褦˥Ѥ뤫ǻȤ꤬ѤäƤ.
ܤ2006ǯ٤μȻ򸫤Ƥ餦ʤɤʬ뤬褯狼Ȥͤ⡤
ۡǥ쥯ȥ .cshrc ΤۤܺǸ if ( $?tcsh ) then ľˤǤ

 set prompt = "%{\e[0;32m%}%m%{\e[0m%}<%U%n%u>%{\e[1;34m%}%~%{\e[0m%} <%h>"

ʤɤȤԤ񤭲äơ

 source ~/.cshrc

ȤƤߤơDzѤ뤫üǤθƤߤ褦.

warning.png prompt ˹ԤȲŤäƤߤ褦
warning.png BSD Ϥ csh ϥ뤬ήǡLinux ʤɤ bsh ϤήॷʬǡꤷƤ

(½)

  • notes.png web δñʻ򸫤ơemacs, vi ξȤꤢȤäƤߤ.
  • notes.png .cshrc Խƺ¥٥Ǥ褤Τ򤷤褦Ūˤϡ.cshrc 򥨥ǥԽơ
    • setenv EDITOR ιܤ򹥤ʥǥ˽(㤨 setenv EDITOR emacs ʤ)
    • setenv PAGER jless ˽(setenv PAGER jless Ȥ)

ʤɤȤʤ롥¾ˤ꤬ΤǡWebʤɤ򻲾ȤĴ٤Ƥߤ褦

  • notes.png jman ee Ȥ ee Υޥ˥奢ɤǤߤ(jman ܸΤǤüǤʤܸˤʤʤ).

ޤǤä󥹥ȡ/ӳǧ

ޤǶ­Ǥޤ󥹥ȡȴԤäˤĤƲԤ.

ץࡤեΥ󥹥ȡˤĤ

FreeBSD ǤϡեȥΥ󥹥ȡˤϰʲΤ褦ˤ褽4ˡ.

󥹥ȡˡ
/usr/sbin/sysinstall Configue Distribution ȤŪʥեȥåȤϤѤƥ󥹥ȡ뤹Τ褤. X äƤʤ!ʤƾϤѤɲäΤ褤. ¸ط⤭ȴ. FreeBSD Foundation ˤäƴ줿Τ󥹥ȡꥹȤäƤʤ.
Package Ѥ. Ūˤ sysinstall Configure Packages ȤƤɤХʥľܻäƤƤ pkg_add ޥɤѤƤ褤*5.Package ȤΤϡ֥ѥѤߥХʥפäƤƥ󥹥ȡ뤹ȤߤʤϤΥХʥΤȤǤ. ¼Ūñʤ륳ԡȤǤΤǡȻ֤ûƺѤߡڤǤ. ѥĶ䥳ѥ륪ץ꤬ѤʤΤǡ٤פˤԸǤ.
ports*6 Ȥ. Ūˤϡ/usr/ports ʲʤɤˤƤΥեȥ̾ΤĤƤǥ쥯ȥ̾פĴ٤Ƥǡportinstall ѤФ褤portinstall ȤʤϡΥǥ쥯ȥ cd ǹԤMakefile ɤĴ make configure make make install ȥޥɤǤĤΤĤƤŵŪʺȤǤ.ϡ֥ץ򥳥ѥ뤹Τɬ׺¤ʾפƤơѥ뤹Ȥ˥ץॽͥåȥͳǼäƤƼǥѥ뤹ȤߤǤ.ɬ׺¤ξ󤷤ʤΤǥǥڡʤѥäƺ٤꤬ΤǤ롥饳ѥ뤹ΤǤΥեȥκǿǤѲǽʤȤ.Ƥ Package Ports Ȥ褦ˤ. ports äƤʤ硤sysinstall Configure Distributions ports ٤Х󥹥ȡǤϤǤ. ޤports ι portsnap ǹԤ뤳Ȥ˳ؽѤߤ
ʬǥѥ뤹.ĤƤϤˡʤäǤ⸶Ūʥ󥹥ȡˡǤ. Ǥ̵̾ʥեȥ伫եȥˤϤˡʤΤǡ ɤǤ褦ˤʤͤФʤʤ. ܺ٤ˤĤƤ 2006ǯαѿ7μȤγʬ*7 Ǥɤߤ.

warning.png 󥹥ȡˡλȤʬܰ¤ȤƤϡ֥󥹥ȡ˻֤򤫤뤫ס֤ɤ줯餤ƥ˱ƶꤽ
ȽǤȤ褤Ūˤϡ ports ǡȤϤ֤Ȥη͹礤ȤȤ

(½)

  • notes.png ports 쥯 /usr/ports ʲˤ뤳Ȥǧ褦.
  • notes.png ports 쥯椫ƤΥեȥõˡΤäƤ
    • ִñʤΤϡpsearch Ȥġ뤬ΤǡȤΤ褤
      ǡportinstall Ѥƥ󥹥ȡ뤷Ƥ
      ο psearch /usr/ports ʲΤɤˤ뤫ϡΤ߼ʸϤˡѤ褦
    • psearch ʳˤϡ㤨õեȥ̾ ABC Ȥ
      (cd /usr/ports; make search name="ABC" )
      Ȥˡʤɤͤ. ¾ˤ⤤ͤΤ;ϤΤԤϹͤƤߤ褦.
       #!/bin/csh -f
       grep '^[^|]*'"$1" /usr/ports/INDEX-7 | awk -F\| '{print $1,":",$2,":",$(NF-1)}' | sort
      Ƚ񤤤 "ports-find" Ȥ륹ץȤä "ports-find ABD" ʤɤȤƤ褤.
  • notes.png ˥󥹥ȡ뤵Ƥ륽եȥˤĤΤˤϡ(Ū Package ʤΤ) pkg_info ȤޥɤȤ˾褦
    Ūˤϡ
     pkg_info 
    ȤñʤꥹȤ
     pkg_info -a
    ȤȴϢƽФƤ.
  • notes.png "fd" Ȥեȥ ports Ȥäƥ󥹥ȡ뤷Ƥߤ褦.
    Ūˤϡfd äƤ/usr/ports Υǥ쥯ȥ(ˡõ)Ĵ٤Ƥơportinstall ѤФ褤
    θ塤fd ޥɤ fd ư뤳("q" exit Ǥ), man fd, jman fd ȤƳơޥ˥奢뤬ɤ뤳ȤǧƤ.

ʤfd Υ󥹥ȡ

Read the document files in /usr/local/share/doc/fd, 
and use the example fd2rc files in /usr/local/etc.

ʤɤȤս񤭤Ϥ. ꤲʤϸƨʤΤǵĤ褦(󤷤ФʤȤ¿)
ʤportinstall ǥ󥹥ȡ뤷Υ /var/log/ports ˻ĤäƤϤʤΤǡɤФ褤*8.

ʤߤˡfd ˤĤƤܸޥ˥奢ɤɤʬ(or ¬Ǥ)Ūˤ /usr/local/etc/fd2rc ƥඦ̤ե롤~/.fd2rc ĿեǤ.

  • notes.png ;ϤΤԤϡƱͤ "rogue" ports 饤󥹥ȡ뤷Ƥߤ(¿ʬ rogue_s 褤).

ǥˤĤ

(˥ϡ)ǥɤˤĤƤϡ

fdisk
ϡɥǥΤɤʬɤ OS Ȥڤʬ.
disklabel
FreeBSD Ѥ˳ݤʬɤȤڤʬ.
newfs
Ǻ٤ڤʬʬ(ѡƥ)Ӥ˱ե륷ƥ
mount
Ǻ٤ڤʬʬɤΥǥ쥯ȥ˳Ƥ뤫 /etc/fstab ʤɤξ󤫤

ȤޥɤȤɬפ.
FreeBSD 󥹥ȡˤϤνŪ˹Ԥ졤ޥɤ sysinstall ¹ԤƤ뤬ֿäƤϡɥǥߤפʤɤξϤΥޥɤռ褤.

(½)

  • notes.png
    less /etc/fstab 
    ȤƤߤơϡɥǥΤɤʬɤΥǥ쥯ȥ˳ƤƤ뤫Ƥߤ褦(ܤ jman fstab Ȥƥޥ˥奢ɤ⤦).
    餯¿ξ /dev/ad0s1* ڤʬƥޥȤƤ(ξ硤/dev/ad0s1 ϺѤƤϡɥǥؤƤ)

ޤ

df

ȤƤߤ.
ޤjman mount, jman umount ȤƥϡɥǥΥǥ쥯ȥؤγƤѤˤϤɤ褤¬(դϸƬ)*9.

  • notes.png CD ȤľɤǤߤ褦
    㤨Сۤ줿 CD ʤɤ CD ɥ饤֤ˤƤ顤ѡ桼
     mount -t cd9660 /dev/acd0 /mnt
    Ȥ CD ɥ饤֤ /mnt Ȥǥ쥯ȥˡ֥ޥȡפƤߤ褦
    θ
     ls /mnt 
    ʤɤȤȡCD Ȥɤ뤳Ȥʬ
    ʤƥޥȤ storage ϡ֥ޥȡ(եȥŪڤΥ)ƤǤʤȡϡɥŪڤΥʤ(ĤޤꡤCD Фʤ)
    CD Ȥɤ뤳ȤǼǤ顤
     umount /mnt
    ȤơޥȤ褦ơCD Ф뤳Ȥǧ褦

ͥåȥ

ͥåȥ򸫤ꡤѤꤹˤϳե/Խɬפ.
ޤǤˤȤƤ餿褦

ޤͥåȥξ

 ifconfig -a 

Ȥ롥

ơ /etc/rc.conf Խ뤳Ȥǽ񤭴롥

ޤ
sysinstall Configure Networking Interface (Ȥͥåȥ: Ƥ־)
ȤƤꤹ뤳ȤŪˤ/Ǥ֤󤳤餬ڤ*10.

٤ƤˤĤưʲäȽҤ٤褦.

IPv6 ?

IP version 6 Ѥ뤫ɤ. 줬̾ѤƤ IP version 4 Ǥ. 2009ǯߤǤϡޤ IPv6 ǤʤФʤʤȤͥåȥ¿ʤ. ̾ No ǹʤ.

DHCP ?

Dynamic Host Configuration Protocol άǡΥޥΥͥåȥͥåȥȤ㤦? Ȥ.
ϤΥͥåȥδԤ/ݥꥷ˰¸ΤǡԤ˿ҤͤƤʤȤʤ*11.
׻Ǥ No Ǥ.
ͭˤϡ/etc/rc.conf

 ifconfig_(ͥåȥ̾)="DHCP"

ȵҤ.

Host name

ͥåȥǤΥޥ̾̾. ƥȷǤꡤʹָξǤ.
DHCP ͭξפʤȤ¿.
׻ǤˤĤƤ轵λ򻲾ȤΤ.
/etc/rc.conf

 hostname="..."

Ƚ񤫤ꤵ(񤫤ƤʬκǽΥɥåȤޤ).

Domain

Υޥ°ͥåȥΤΤ̾.
ȤǸнΤ褦ʤ.
DHCP ͭξפʤȤ¿.
׻ǤˤĤƤ轵λ򻲾ȤΤ.
/etc/rc.conf

 hostname="..."

Ƚ񤫤ꤵ(񤫤ƤʬκǽΥɥåȰʹ).

Gateway

°ͥåȥγؤνи(Ѿ).
̾ IP ǵ.
DHCP ͭξ.
׻ǤˤĤƤ轵λ򻲾ȤΤ.
/etc/rc.conf

 defaultrouter="..."

Ƚ񤫤ꤵ.

Name server

ۥ̾ IP Address ѴɤΥФ˿ҤͤФ褤Ȥ.
줬̵¾ΥޥؤΥۥ̾ǤΥǤʤ*12.
DHCP ͭξ.
׻ǤˤĤƤ轵λ򻲾ȤΤ.
/etc/resolv.conf

 nameserver ...

Ƚ񤫤ꤵ.

IP Address

ޥ󤬥ͥåȥǻֹ. ɽ졤ξ.
ͥåȥߤμºݤΥ IP Address ȤäƤ뤿ᡤʤȤ°ͥåȥǤ IP Address ͣǤʤȤʤ.
DHCP ͭξ.
׻ǤˤĤƤ轵λ򻲾ȤΤ.
/etc/rc.conf

 ifconfig_(ͥåȥ̾)="inet ....  netmask ...."

Ƚ񤫤줿 inet .... ʬꤵ.

Netmask

ʬ IP 򵭤ȤˡɤޤǤͥåȥλֹǡɤ餬ʬΥޥ(ΥͥåȥΤʤ)ֹ椫̤뤿˻Ȥ.
ʿɽȤ "1" ˤʤȤޤǤͥåȥξ "0" ˤʤȤޥѤξȤȤˤʤäƤ.
"." Ƕڤä10ʿɽ0x ƬˤĤ 16ʿɽ.
DHCP ͭξ.
׻ǤˤĤƤ轵λ򻲾ȤΤ.
/etc/rc.conf

 ifconfig_(ͥåȥ̾)="inet ....  netmask ...."

Ƚ񤫤줿 netmask .... ʬꤵ.

(½)

  • notes.png Υͥåȥե(/etc/rc.conf, /etc/resolv.conf)ɤdzΤ.
  • notes.png ºݤ
     ifconfig -a
    ȤƤߤơͥåȥȾȹ礻.

¾, ͥåȥ˴ؤƥ󥹥ȡ˸줿٤

inetd ?

ͥåȥӥդǤ inetd (dzؽ)Ƥ? ȤǤ.
ɬפʤ /etc/rc.conf

 inetd_enable = "YES"

Ƚ񤱤Ф褤.

sshd ?

ǡŹ沽줿ϩǤ ssh μդ򤹤뤫? ȤǤ.
ͭˤƤΤ褤.
/etc/rc.conf

 sshd_enable = "YES" 

Ƚ񤱤Ф褤.

NFS server ? NFS client ?

ͥåȥͳǥϡɥǥȤ褦ˤ뤫? ȤǤ.
server ϡ֥ϡɥǥäƤ¦סclient ϡ֤Ѥ¦פǤ.
NFS λȤߤϽפΥեȥϤȤˤ. Ȥˤϳơ /etc/rc.conf

 nfs_server_enable = "YES" 
 nfs_client_enable = "YES" 

Ƚ񤱤Ф褤.

Console ܡɤ

ҤäƤ륭ܡɤ򥳥󥽡ǤĤ硤ܡɤ碌ƤȤ褤.
Ѹ쥭ܡɤʤä˲⤹ɬפϤʤܸ쥭ܡɤξ /etc/rc.conf

 keymap="jp.106"

ʤ

 keymap="jp.106x"

Ƚ񤤤Ƥ(Ԥ Ctrl Caps εǽ򴹤ƻȤ).

mouse

ޥȤʤ! ȤϾʤޤꤷƤΤ褤.
/etc/rc.conf ǤΤΤ򻲾Ȥ褦

notes.png ꤬ߤɤʤäƤ뤫/etc/rc.conf 򸫤ƳΤ.

ȴ

Unix OS Ǥϥ桼ȤϰʲΤ褦ʾǴ.

̾id
ƥȤǹ륢̾. ͣǤɬץ.
uid
ΥȤ̤뤿ֹŪʤΤñʤ. ƥ͡ʸ¤뤫ɤ uid Ƕ̤.󥷥ƥ䥷ϥ̾ǥȤ̤*13 sysinstall, adduser ޥɤʤɤǤϼưŪ˸䤬.
Group
ΥȤ°륰롼̾. ƥ͡ʸ¤Ϥ uid Ƚ°롼פǶ̤ΤǡɤΥ롼פ°뤫Ͻפּˡ°ƤʤƤ褤Τǡ¤ϤŬǤ褤. sysinstall, adduser ޥɤʤɤǤϼưŪ˸䤬.
Password
ʤɤɬפʥѥ. ǥ桼
 passwd
ȤѹǤ. ԤȤΥѥɤͳǤ.
Full name
ե͡. ʹѾʤΤǡ¤ϲ񤤤Ƥ褤.
Member group, Other group
¾°Ƥ륰롼̾. Ͻ. ȤǴԤˤʤ٤ͤȤȤϤȤꤢ wheel, operator ȤƤ٤. wheel °ƤȴԤˤʤ븢¤operator °Ƥ͡üʥޥɤȤ¤.
Home directory
Υȥ桼ͭǻȤǥ쥯ȥ. ̾ /home/̾ Ȥ뤳Ȥ¿. sysinstall, adduser ޥɤʤɤǤϼưŪ˸䤬.
Login Shell
Ȥ. /etc/shells ˥ꥹȥåפƤΤ椫餷٤ʤΤ*14. "nologin" ̤ǡ֤ȥǤʤʤ褦ˤʤäƤ. ǥ桼
 chsh -s /bin/tcsh
ʤɤȤѹǤ.

ơξˡϼ˰ʲ3̤Ǥ.
(root,ѡ桼)ǤʤȽʤȤǤ뤳ȤϸޤǤʤ.

ˡ
adduser ޥɤȤ(). ְ㤨 Ctrl-C ǻߤФ褤(ҤΥޥɤȤä). ѹפˤϻȤʤ.
sysinstall Configure User Management Ȥˡ굤. ֽפˤϻȤʤ.
ޥɤȤǽŪˤϤ줬ɬ.

vipw ̾uid, 祰롼id, ե͡, ۡǥ쥯ȥλ, 󥷥ꤹ륳ޥ. Ūˤϡǥ*15 /etc/passwd ե׸ƤӽФ.ΥޥɰʳˡǤΥեԽ뤳Ȥϰ̣ʤΤդ.

/etc/group ե ̤˥ǥԽ. 롼פκԽȤν°ͳԽǤ.

ȡadduser sysinstall Ѥʤϥۡǥ쥯ȥ꤬ưŪ˺櫓ǤϤʤȤˤդɬפ.

ȥ

¤ʤС󤷤֤¾Υ桼ˤʤ꤫뤳ȤǤ.
㤨Сѡ桼 "hogehoge" Ȥ桼ˤʤ꤫ꤿ

 su hogehoge

ȤФ褤.
դˡ̤Υ桼ѡ桼ˤʤ꤫ꤿ

su

ȤФ褤(ѡ桼ΥѥɤΤʤȸ¤ʤϵ䤵).

(½)

  • notes.png ξ٤ꤢοͤ͡ΥȤ. ơޤ̤˥󥽡뤫Ǥ뤳Ȥǧ. ˡοͤˤοͤΥޥ󤫤 ssh ǥ󤷤㤤Ǥ뤳Ȥǧ. ʤssh ǤΥ
     ssh ޥǤμʬΥ̾@ޥΥۥ̾
    Ȥ.
  • notes.png furihata ȤȤ. ΥȤΥѥɤϼȻ˸Ƭ.

ݡ

ԤäȤˤĤ furihata ä cmc.osaka-u.ac.jp ˥᡼𤻤.
Ƽ

  1. °(ز)
  2. ֹ
  3. ǯ
  4. ̾
  5. οΥݡ(θȤˤĤƵŤ)

񤯤Τ˺ʤ褦.

about Icons

Some icons in this page are downloadable at ICONFINDER.
The "note" icon notes.png designed by Marco Martin is distributed with the LGPL licence
and the "warning" icon warning.png designed by Alexandre Moore with the GPL licence.
Thank you Marco and Alexandre!


*1 X Ω夲ʤ֤Υ󥽡ȤäƤ⹽ʤ
*2 Alt+F2 2ĤΥ󥽡롤Alt+F3 ȣĤΥ󥽡ˤʤ
*3 X Alt+F9 ꤫
*4 ǶϴѤ GUI ¿ƤΤΤϡ֤֤פǤ
*5 ξϰ¸طϼưŪ˲褵ʤϤ
*6 ¤ϡports ϥ饳ѥ뤹뤿Ρ־פ򽸤᤿ΤΤǤ.ѥ뤷̤Ūˤ Package Ȥưƥ󥹥ȡ뤵.äơports Ǥ Package Ǥ⥽եȤΥ󥹥ȡ Package Ȥư.
*7 linux ȤäƤ뤬ܤϰ.
*8 ϽפʤΤ
*9 褯ʬʤ mount ޥɤ umount ޥɤ¹Ԥʤ!!
*10 /etc/rc.conf ϼưŪˡɵפ콤ʤΤ sysinstall ꤹ٤˱ʤ.Ŭʻ˿ʹ֤ǥˤ褤. ʤߤ /etc/rc.conf εҤϲ̤ۤͥ⤤.
*11 㤨СVMwarePlayer Ǥ NAT + DHCP ˤΤڤʤ.
*12 դ˸СIP Address ʬäƤ Name server ʹʤƤ⥢Ǥ. ؤ.
*13 ĤޤꡤƱ uid ̾ۤʤ륢(̾)뤳Ȥǽ.ȤˤäƤϤȤƤ褯ʬä̵ͤˤȤäƤϺΤȤ.
*14 Ȥ뤬 /etc/shells ˽񤤤Ƥʤ root ǽ񤭹Ǥ
*15 ɤΥǥƤФ뤫ϴĶѿ "EDITOR" ˤ. ꤷƤʤ vi ФƤ

źեե: filenotes.png 624 [ܺ] filewarning.png 210 [ܺ]