Opisanie UNIX ! Nach.svedeniya
! Bolee podrobnye
! YAzyk SHELL
! O terminalah
---------------------------------------------------------------
Perenaznachenie sistemnyh potokov
file Sistemnyj vyvod
2> Sistemnyj protokol 2>>file - dopisyvat' v konec fajla
---------------------------------------------------------------
Prostoe imya fajla <=14 simvolov
rk [file] tekstovyj redaktor
cd dire - perejti v direktoriyu dire
cd ../ - prijti v predydushchuyu direktoriyu
cd - prijti v svoyu direktoriyu
pwd - poluchit' imya tekushchej direktorii
---------------------------------------------------------------
who -a kto v sisteme
tty imya terminala
date sistemnaya data
du [-s] pamyat', zanyataya direktoriej (i poddirektoriyami) v Kb
df svobodnaya pamyat' na diskah, v Kb
env znachenie peremennyh okruzheniya
export TERM eksportirovat' peremennuyu TERM v okruzhenie
---------------------------------------------------------------
mail poslat' pol'zovatelyu pochtu. Prorochitat' prishedshuyu pochtu.
write logname poslat' pol'zovatelyu na terminal.
mesg n zapretit' "zvonit'" na svoj terminal.
---------------------------------------------------------------
ps -ef Informaciya o sostoyanii processov
kill [-9] 2745 Avarijnoe zavershenie processa ° 2745
---------------------------------------------------------------
ls - raspechatat' informaciyu o fajlah ili direktoriyah sm ls.txt
ls -RadCxmnlogrtucpFbqisf [files ...]
-l polnaya informaciya
-a imena vseh fajlov
-s razmer
-m Vyvod cherez zapyatuyu.
-x v 4 kolonki
-r sortirovat' v obratnom poryadke
-t sortirovat' po vremeni modifikacii
-u sortirovat' po vremeni dostupa
-d ne vyvodit' dlya kataloga ego soderzhimoe
-f podkatologi
-R vyvodit' soderzhanie poddirektorij
-p posle katalogov risovat' /
find / -name *flop* -print najti polnoe imya fajla
find /udd /util -name ccp -print
---------------------------------------------------------------
cat file1 ... [>file] - slit' i vyvesti fajly na standartnyj vyvod
cp file1 file2 kopirovat' fajl
cp file1 dire2 kopirovat' fajl v direktoriyu
find . -print|cpio -pdmv katalog kopirovat' direktoriyu s soderzhimym
echo >file - sozdat' pustoj fajl
mkdir dire - sozdat' direktoriyu
mv file1 file2 - pereimenovat' fajl
mv file1 dire2 - peremestit' fajly
/usr/lib/mv_dir - pereimenovanie direktorij
rmdir -r dire - udalit' direktoriyu vmeste s soderzhimym
rm -i fajly - udalenie s podtverzhdeniem
rm -f fajly - bezuslovnoe udalenie
bson chown moshkow '*' '.*' Izmenenie vladel'ca u vseh fajlov
chown moshkow file Izmenenie vladel'ca fajla
chgrp 90 file Izmenenie gruppy u fajla
chmod [ugo] [+ -] [rwxs] file Izmenenie prav dostupa
[]
chmod go+rw ,u+rwxs max/*
echo [file] - vyvesti argumenty na standartnyj vyvod
---------------------------------------------------------------
diff Sravnit' dva fajla.
grep Najti v ukazannom fajle (fajlah) zadannyj shablon.
nohup Zapustit' vypolnenie komandy v fonovom rezhime.
pg Vyvesti, postranichno, na terminal.
uname Vyvesti imya tekushchej sistemy UNI.
uucp Pereslat' ukazannyj fajl na druguyu sistemu UNIX.
uuname Vyvesti spisok udalennyh sistem UNIX.
uupick Vypolnit' poisk fajlov, peredannyh pol'zovatelyu s po-
---------------------------------------------------------------
cc [2>>file] file.c [-lcurses] kompilirovat' fajl na Si
[oshibki v nego zhe] [biblioteka s "TTDIO"]
cb [-s] file.c >file1.c ukrashatel' Si programm [v stile knizhki]
ctrace file.c >file2.c poluchit' ottrassirovannuyu programmu na Si
??? file.bld ? redaktor svyazej
---------------------------------------------------------------
pack - programma upakovki fajla v dvoichnom kode (szhatie fajla)
pcat .z - programma chteniya upakovannogo fajla
upack .z - programma raspakovki fajla
---------------------------------------------------------------
formatflop formatirovat' flopidisk
pered formatirovaniem dos diskety nel'zya govorit' flon! Inache vynut', potom vstavit'.
flon podklyuchit' flopidisk v direktoriyu /mnt
floff otklyuchit' flopidisk
/etc/fsck -y /dev/dsk/fd - reanimaciya diskety
cpp -a file /dos skopirovat' fajl na flopidisk v formate DOS
ccp -A /dos file prochitat' fajl v formate DOS s flopidiska
ls /dos
cleall pochistit' disk, dolbanuv lishnie fajly
bson mtobl -e& prochistit' lentu
copall zamotat' /udd na magnitnuyu lentu
restall vosstanovit' dannye s lenty v tekushchuyu direktoriyu
Kopirovanie s lenty dd if=/dev/mt bs=256k | cpio -idmvu
zamotat' fajly na lentu
find /udd /etc/passwd.old -print | cpio -ovB > /dev/rmt
cpio -idmvB [file-shablon] < /dev/rmt
perepisat' s lenty v tekushchuyu direktoriyu
---------------------------------------------------------------
su [-] monah stat' drugim pol'zovatelem [i s ego okruzheniem]
bson stat' superpol'zovatelem
---------------------------------------------------------------
case $a in
*.out) rm $a ;;
shablon ) komandy ;;
. . .
esac
pozicionnye peremennye:
$@ $1 $2 ...
$* "$1 $2 ..."
$# kolichestvo pozicionnyh parametrov (desyatichnoe)
$- flagi, ukazannye pri zapuske shella ili komandoj set
$? desyatichnyj kod, vozvrashchennyj predydushchej komandoj
$$ nomer tekushchego processa
$! nomer poslednego asinhronnogo processa
`komanda` podstavit' v stroku vyvod komandy.
i=25
while [ $i -lt 100 ]
do
# telo cikla
done
Kak vernut' fajl v man formate v ascii. I udalit' v nem vse simvoly "_"
#nroff -man manl/waisindex.l | sed -e 's/_//g' > waisindex.txt
VI prostejshie komandy
/usr/lib/assist/lib/scripts
CURSOR MOVING COMMANDS ADDING TEXT COMMANDS
SPACE .. forward one character i ..... insert text to cursor left
... backward one character a ..... add text to cursor right
j ...... jump-down one line o ..... open line below current line
k ...... kick-up one line O ..... open line above current line
w ...... word forward
b ...... backward-word ... erase characters in input mode
6k ..... move down 6 lines .. Stop inputting text; return to
4b ..... move back 4 words command level of vi
DELETING COMMANDS WRITING AND QUITTING
x ...... x-out character :w ... save (write) changes
dw ..... delete word :q ... quit vi
dd ..... delete entire line :q! .. quit vi without saving the
3x ..... delete (x-out) 3 chars changes made since the last
6dw .... delete 6 words write command
4dd .... delete 4 lines
SETTING vi OPTIONS
UNDO COMMAND :set nu ..... line numbering on
u ...... undo last editing change :set nonu ... line numbering off
u ...... redo (undo last undo) :set smd .... show mode option on
y7y zapomnit' sem' strok
p vspomnit'
Last-modified: Tue, 25 Nov 1997 07:07:42 GMT