Na ekrane terminala poyavlyaetsya priglashenie
login:
Vvedite imya, pod kotorym vy zaregistrirovany v sisteme,
esli nuzhno, parol'. Esli Vy oshiblis' pri vvode imeni, nazhmite
CTRL+U, ili DEL, ili CTRL-D (dlya otmeny), ili neskol'ko raz
nazhmite na Return, poterpite nemnogo i povtorite vvod.
Na ekrane poyavitsya priglashenie komandnogo interpretatora.
sunsite:~/$ _
CHtoby vyjti iz sistemy, naberite komandu exit ili prosto
nazhmite Ctrl-D na pustoj strochke.
Pri vhode v sistemu dlya pol'zovatelya avtomaticheski
ustanavlivaetsya neskol'ko peremennyh okruzheniya. CHtoby
posmotret' ih znachenie, vypolnite komandu env.
env # Raspechatat' proeksportirovannye peremennye okruzheniya
LOGNAME=moshkow # imya pol'zovatelya
HOME=/home/moshkow # ego domashnij katalog
SHELL=/bin/ksh # ego komandnyj interpretator
MAIL=/usr/mail/moshkow # fajl, v kotoryj skladyvaetsya
# prihodyashchaya emu pochta
PS1=host1:$PWD/$ # format priglasheniya
PATH=:/usr/local/bin:/bin:/usr/bin:/usr/X11/bin:/usr/informix/bin:
# spisok poiska, po kotoromu ishchutsya vypolnimye fajly
TERM=vt100 # ustanavlivaet tip terminala, na
# kotorom rabotaet pol'zovatel'
CHtoby zadat' znachenie peremennoj okruzheniya, vypolnite
komandu:
Imya_Pereemennoj=znachenie export Imya_Pereemennoj
naprimer
abc=Kalosha export abc
prosmotret' znachenie peremennoj mozhno komandoj echo v takoj
forme:
echo $abc
Pered vhodom v sistemu sperva vypolnyaetsya obshchesistemnyj
profajl /etc/profile
Zatem vypolnyaetsya pol'zovatel'skij fajl ".profile" (esli
on est') - v nih mozhno ustanavlivat' peremennye okruzheniya i
delat' ustanovki rezhimov terminala. Prosmotret' ustanovlennye
peremennye okruzheniya mozhno komandoj env
##### Primer fajla .profile ##################################
# Dobavit' k spisku poiska katalogi s nuzhnymi programmami
PATH=:$HOME/bin:$PATH:/usr/sbin:/usr/local/bin:/usr/informix/bin
# Razreshit' redaktirovanie komandnoj stroki v ksh
EDITOR=emacs
export PATH EDITOR
LC_CTYPE=iso_8859_1 export LC_CTYPE # russkie bukvy - "bukvy"
# Harakteristiki terminala
# Zaboj=BackSpace Steret'Stroku=Ctrl-U
# Prervat'Programmu=Ctrl-C "ZHestokoe_preryvanie"=Ctrl-|
stty erase "^h" echoe kill "^u" quit "^|" intr "^c"
stty cs8 -parenb -istrip
# 8-bitnye simvoly, noparity, ne usekat' 8-j bit
# pri vvode
case "$0" in # V zavisimosti ot komandnogo interpretatora
*ksh) # V Korn Shelle
# Redaktirovat'sya strelochkami
alias __A=`echo "\020"` # ^P = vos'merichnyj 020
alias __B=`echo "\016"` # ^N
alias __C=`echo "\006"` # ^F
alias __D=`echo "\002"` # ^B
# V priglashenie stavit' tekushchij pwd
PS1=$LOGNAME@`uname -n`:'$PWD/$ ' export PS1
;;
*bash) # V bash'e v priglashenie stavit' host:pwd
PS1='\h:\w/\$ ' export PS1
ulimit -Sc 0 # chtob programmy core ne ronyala
;;
*sh) # dlya posix-shell i HP-UX
PATH=$PATH:/usr/sbin
PS1=$LOGNAME@`uname -n`:'$PWD/$ '
HISTFILE=$HOME/.sh_history
ENV=$HOME/.kshrc
export PATH ENV HISTFILE PS1
# i ne zabyt' v fajl .kshrc vpisat' set -o emacs
;;
esac
# obratite vnimanie: v nekotoryh mestah PROSTAYA kavychka _'_
# a v drugih - OBRATNAYA _`_ - bud'te vnimatel'ny, eto vazhno.
Klavishi dlya redaktirovaniya komandnoj stroki
Esli vy rabotaete v komandnom interpretatore Korn-Shell
/bin/ksh, i u vas ustanovlena peremennaya EDITOR=emacs, to vy
smozhete redaktirovat' komandnuyu stroku s pomoshch'yu strelok i
Ctrl-klavish:
^P / ^N PREVIOUS / NEXT komanda
^F / ^B FORWARD / BACK na poziciyu
^A / ^E v NACHALO / KONEC stroki
^D / ^K Udalit' SIMVOL / Udalit' KONEC STROKI
^Y Vspomnit' udalennoe
^R Poisk predydushchej komandy
ESC ESC Dobit' imya fajla
ESC = Raspechatat' pohozhie imena fajlov
a esli komandnyj interpretator bash, to obe eti komandy
sidyat na klavishe TAB
CHtoby provesti vyklyuchenie sistemy, sleduet, buduchi
pol'zovatelem root i nahodyas' v kornevom kataloge, vypolnit'
komandu shutdown (klyuchi komandy zavisyat ot vashej operacionnoj sistemy)
cd /
shutdown -yh 0 # HPUX
shutdown -h now # Tru64, FreeBSD, Linux
shutdown -y -g0 -i0 # Solaris, SVR4
Dozhdites' polnogo okonchaniya razgruzki sistemy i tol'ko
togda vyklyuchajte pitanie.
Dlya perezagruzki sistemy vypolnite komandu
reboot # Linux
shutdown -y -r 0 # HPUX
shutdown -y -g0 -i6 # Solaris, SVR4
Perezagruzit' ili razgruzit' sistemu mozhno takzhe i iz menyu
sistemnogo administratora komandy sysadm.
V nekotoryh realizaciyah Unix (v chastnosti, v BSD, SunOS,
Linux, HP-UX) komanda shutdown ispol'zuet drugie klyuchi.
Poprobujte v etom sluchae:
shutdown -y -h now # dlya ostanovki
shutdown -y -r 60 # dlya perezagruzki cherez 60 sekund
Last-modified: Sun, 07 Aug 2005 11:35:35 GMT