Ȼ/04

Top / Ȼ / 04

ɤդ

ޤǤμȤ˺ȤɤդƤʤȤԤϵޤɤդ.

줫κȴĶ

ʸü

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

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

  • ¾ˤ(󥹥ȡ뤷Ƥ) kterm rxvt ʤɤʸüߥ졼ȤƻȤ.
    GNOME ü
    kterm &
    rxvt &
    ʤɤȤΩ夬뤫Ƥߤ褦(ȤäƤߤ󥹥ȡ뤵ƤʤȤʤиҤΡפΤȤɤ٤).
    ȤäƤߤƤ餬äΤä顤˥塼Ȥ褦ˤƤΤ褤.

ʣΥ󥽡

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

 less /etc/ttys

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

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

(½)

嵭Υ󥽡ڤؤƤߤ褦. ơäƤߤ褦*4.

ǥ

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

Unix ǤΥǥϴŪ

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

Τ줫ȤȤˤʤ(ͳ͡뤬).
桼󥿥եɤ⤯鿴Ԥˤϥĥ饤ΤΤǡUnix OS ¿Ͻ鿴Ѥ˶۵ŪʥǥѰդƤ.
FreeBSD Ǥ "ee" ȤʰץǥѰդƤΤǡ鿴ԤϤ̾ФƤɤΤʤ.

(½)

  • web δñʻ򸫤ơemacs, vi ξȤꤢȤäƤߤ.
  • ee ưư̤ȤäƤߤ. ޤjman ee Ȥƥޥ˥奢ɤǤߤ.

ޤǤä󥹥ȡ/ӳǧ

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

ץࡤեΥ󥹥ȡˤĤ

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

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

(½)

  • ports 쥯 /usr/ports ʲˤ뤫å. ʤХ󥹥ȡ뤷Ƥ.
  • ports 쥯椫ƤΥեȥõˤϤˡͤ뤬ִñʤΤõեȥ̾ ABC Ȥ
    (cd /usr/ports; make search name="ABC" )
    Ȥˡ. ¾ˤ⤤ͤΤ;ϤΤԤϹͤƤߤ褦. 㤨ж
     #!/bin/csh -f
     grep '^[^|]*'"$1" /usr/ports/INDEX-6 | awk -F\| '{print $1,":",$2,":",$(NF-1)}' | sort
    Ƚ񤤤 "ports-find" Ȥ륹ץȤä "ports-find ABD" ʤɤȤƻȤäƤ. make search ... ̤ȤǸפ.

ʤߤˡ˥󥹥ȡ뤵Ƥ륽եȤ Package ʤΤ

 pkg_info -a

ƾ󤬽ФƤ.
ȸˤΤǡ㤨Х(csh ξ)

 alias pkg_list "pkg_info -a | grep 'Information for' | sed 's/Information for //'"

ʤɤꤷƤС

 pkg_list

Ȥޥɤ ports/Package ˤäƥ󥹥ȡ뤵Ƥ륽եȥΥꥹȤФƤ.

  • "fd" Ȥեȥ ports Ȥäƥ󥹥ȡ뤷Ƥߤ褦.
    Ūˤϡfd ̾Υǥ쥯ȥ(ˡõ)˰ư
    make configure  make  make install  
    Ȥƥ󥹥ȡ뤷fd ޥɤ fd ư뤳("q" exit Ǥ), man fd, jman fd ȤƳơޥ˥奢뤬ɤ뤳Ȥǧ. θ塤
    make clean 
    ȤƥѥˤΤɬפäեȤȤˤʤ.ʤ
    Read the document files in /usr/local/share/doc/fd, 
    and use the example fd2rc files in /usr/local/etc.
    Ȥս񤭤 make install ˽Ф. ꤲʤƨʤ褦(󤷤ФʤȤ¿).
    ʤߤˡfd ˤĤƤܸޥ˥奢ɤɤʬ(or ¬Ǥ)Ūˤ /usr/local/etc/fd2rc ƥඦ̤ե롤~/.fd2rc ĿեǤ.
  • ;ϤΤԤϡƱͤ rogue ports 饤󥹥ȡ뤷Ƥߤ.

ǥ

(˥ϡ)ǥɤˤĤƤϡ

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

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

(½)

less /etc/fstab 

ȤƤߤơϡɥǥΤɤʬɤΥǥ쥯ȥ˳ƤƤ뤫Ƥߤ.

df

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

ͥåȥ

ͥåȥ򸫤ꡤѤꤹˤϳե/Խɬפ.
㤨С

 ifconfig -a 

ȤȥͥåȥεŪ꤬.

sysinstall Configure Networking Interface (Ȥͥåȥ: Ƥ־)
ȤƤꤹ뤳ȤŪˤǤ֤󤳤餬ڤ*10.
ƤˤĤƤޤäȽҤ٤褦.

IPv6 ?

IP version 6 Ѥ뤫ɤ. 줬̾ѤƤ IP version 4 Ǥ. 2007ǯߤǤϡޤ 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 .... ʬꤵ.

(½)

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

¾٤

inetd ?

ͥåȥӥդǤ inetd Ƥ? ȤǤ.
ɬפʤ /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

 moused_enable = "YES" 

Ƚ񤤤Ƥ.

꤬ߤɤʤäƤ뤫/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

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

(½)

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

ݡ

ԤäȤˤĤ furihata ä cmc.osaka-u.ac.jp ˥᡼𤻤.
ƼΡֽ°ǯֹ桤̾פ񤯤Τ˺ʤ褦.


*1 X Ω夲ʤ֤Υ󥽡ȤäƤ⹽ʤ
*2 ǥեȤäƤΤǽϺ. ܸޥ˥奢.
*3 Alt+F2 2ĤΥ󥽡롤Alt+F3 ȣĤΥ󥽡ˤʤ
*4 X Alt+F9 ꤫
*5 ǶϴѤ GUI ¿ƤΤΤϡ֤֤פǤ
*6 ξϰ¸طϼưŪ˲褵ʤϤ
*7 ¤ϡports ϥ饳ѥ뤹뤿Ρ־פ򽸤᤿ΤΤǤ.ѥ뤷̤Ūˤ Package Ȥưƥ󥹥ȡ뤵.äơports Ǥ Package Ǥ⥽եȤΥ󥹥ȡ Package Ȥư.
*8 linux ȤäƤ뤬ܤϰ.
*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 ФƤ