Ȼ/04

Top / Ȼ / 04

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

줫κȴĶ

ʸü

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

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" ȤʰץǥѰդƤΤǡ鿴ԤϤ̾ФƤɤΤʤ.

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Ѥ뤫üǤθƤߤ褦.

(½)

  • 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-7 | awk -F\| '{print $1,":",$2,":",$(NF-1)}' | sort

Ƚ񤤤 "ports-find" Ȥ륹ץȤä "ports-find ABD" ʤɤȤƤ褤.

ͥ줿ˡȤơpsearch Ȥġ뤬Τǡ¤Ϥ줬.

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

 pkg_info 

ȤñʤꥹȤ

 pkg_info -a

ȤȴϢƽФƤ.

  • "psearch" ports 饤󥹥ȡ뤹ȶˡȤäƤߤ.
    Ūˤϡpsearch ̾Υǥ쥯ȥ(ˡõ)˰ư
    make configure  make  make install  
    Ȥƥ󥹥ȡ뤹뤫portinstall ޥɤѤ.
  • "fd" Ȥեȥ ports Ȥäƥ󥹥ȡ뤷Ƥߤ褦.
    Ūˤϡfd ̾Υǥ쥯ȥ(ˡõ)˰ư
    make configure  make  make install  
    Ȥƥ󥹥ȡ뤹뤫*9portinstall ޥɤѤ.
    θ塤fd ޥɤ fd ư뤳("q" exit Ǥ), man fd, jman 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 ˻ĤäƤϤʤΤǡɤФ褤*10.

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

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

ǥˤĤ

(˥ϡ)ǥɤˤĤƤϡ

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

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

(½)

less /etc/fstab 

ȤƤߤơϡɥǥΤɤʬɤΥǥ쥯ȥ˳ƤƤ뤫Ƥߤ褦(ܤ jman fstab Ȥƥޥ˥奢ɤ⤦).

ޤ

df

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

ͥåȥ

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

 ifconfig -a 

ȤȥͥåȥεŪ꤬.

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

IPv6 ?

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

DHCP ?

Dynamic Host Configuration Protocol άǡΥޥΥͥåȥͥåȥȤ㤦? Ȥ.
ϤΥͥåȥδԤ/ݥꥷ˰¸ΤǡԤ˿ҤͤƤʤȤʤ*13.
׻Ǥ 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 ѴɤΥФ˿ҤͤФ褤Ȥ.
줬̵¾ΥޥؤΥۥ̾ǤΥǤʤ*14.
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 Ƕ̤.󥷥ƥ䥷ϥ̾ǥȤ̤*15 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 ˥ꥹȥåפƤΤ椫餷٤ʤΤ*16. "nologin" ̤ǡ֤ȥǤʤʤ褦ˤʤäƤ. ǥ桼
 chsh -s /bin/tcsh
ʤɤȤѹǤ.

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

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

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

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

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

ȥ

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

 su hogehoge

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

su

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

(½)

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

ݡ

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

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

񤯤Τ˺ʤ褦.


*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 ξ硤󥹥ȡ make clean ȤƥѥˤΤɬפäեǥ̵̤ˤʤʤ.
*10 ϽפʤΤ
*11 褯ʬʤ mount ޥɤ umount ޥɤ¹Ԥʤ!!
*12 /etc/rc.conf ϼưŪˡɵפ콤ʤΤ sysinstall ꤹ٤˱ʤ.Ŭʻ˿ʹ֤ǥˤ褤. ʤߤ /etc/rc.conf εҤϲ̤ۤͥ⤤.
*13 㤨СVMwarePlayer Ǥ NAT + DHCP ˤΤڤʤ.
*14 դ˸СIP Address ʬäƤ Name server ʹʤƤ⥢Ǥ. ؤ.
*15 ĤޤꡤƱ uid ̾ۤʤ륢(̾)뤳Ȥǽ.ȤˤäƤϤȤƤ褯ʬä̵ͤˤȤäƤϺΤȤ.
*16 Ȥ뤬 /etc/shells ˽񤤤Ƥʤ root ǽ񤭹Ǥ
*17 ɤΥǥƤФ뤫ϴĶѿ "EDITOR" ˤ. ꤷƤʤ vi ФƤ