調(diào)適計算機用法_第1頁
調(diào)適計算機用法_第2頁
調(diào)適計算機用法_第3頁
調(diào)適計算機用法_第4頁
調(diào)適計算機用法_第5頁
已閱讀5頁,還剩20頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

調(diào)適計算機用法

ok>show-devs

ok>show-disks

終端控制

ctrl+s:終止屏幕輸出,如用cat命令輸出時,要停一下

ctrl+q:恢復(fù)ctrl+q的輸出

ctrl+c:中斷當(dāng)前的活動,返回命令提示符

ctrl+d:表示文件的結(jié)束或退出,如退出終端窗口

ctrl+u:擦除整個命令行

ctrl+w:擦除命令行最后一個單詞

ctrl+h:擦除命令行最后一個字符

be:計算器

#ksh切換到kshell

命令:

#uname

SunOS

NAME

#manuname

uname-printnameofcurrentsystem

SYNOPSIS

uname[-aimnprsvX]

uname[-Ssystemname]

#date

2004年05月19日星期三21時57分49秒CST

#

stings

$stings/usr/bin/cat

能夠用來打印可執(zhí)行文件或二進制文件中的可讀字符。

catmore

#cat-ntest,txt〃顯示行號

鍵值目的

空格滾動到下一屏

回車一次滾動一行

b向后移動一屏

f向前移動一屏

h顯示更多特性的幫助菜單

q退出,返回shell提示符

/string向前搜索字符串string

n查找下一處匹配

less

#lesstest,txt〃前移動一屏F,后B,/string查找字符

head

fthead-5/export/home/wing/test.txt//顯示開始的5行

#headchap*more〃顯示所有以chap開頭的文件的頭部

用來顯示一個或多個文件的前n行,默認省略-n參數(shù)將顯示文件的

前10行。

tail

#tail-5/export/home/wing/test.txt〃顯示最后5行

#tai1+5/export/home/wing/test.txt//顯示第5行開始到結(jié)束

用來顯示一個文件的最后n行,默認省略-n參數(shù)將顯示文件的最后

10行。

#tail-f/var/adm/messages〃實時自動瀏覽syslog入口

Oct600:20:26winggenunix:[ID936769kern,info]sdOis

/pci@0,0/pci-ide@7,l/ide@l/sd@0,0

Oct600:20:26wingpcplusmp:[ID637496kern,info]pcplusmp:

fdc(fdc)instance0vector0x6ioapi

c0x1intin0x6isboundtocpu0

Oct600:20:26winglastmessagerepeated1time

Oct600:20:26wingisa:[ID202937kern,info]ISA-device:fdcO

Oct600:20:26wingfdc:[ID114370kern,info]fdOatfdcO

Oct600:20:26winggenunix:[ID936769kern,info]fdOis

/isa/fdc@l,3f0/fd@0,0

Oct600:20:30wingi8042:[ID526150kern,info]8042device:

mouse@l,mouse8042#0

Oct600:20:30winggenunix:[ID936769kern,info]mouse80420

is/isa/i8042@l,60/mouse@l

Oct600:21:37winglogin:[ID722452auth.error]user2netname:

(nis+lookup):ErrorinaccessingN

IS+coldstartfile...isNIS+installed?

Oct600:21:47winglastmessagerepeated1time

Oct600:52:07winglogin:[ID722452auth.error]user2netname:

(nis+lookup):ErrorinaccessingN

IS+coldstartfile...isNIS+installed?

wc

#wc/export/home/wing/test.txt〃顯示文件的行、單詞、字節(jié)數(shù)

#wc-1/export/home/wing/test.txt〃顯示文件的行數(shù)

選項功能

-1統(tǒng)計行數(shù)

-w統(tǒng)計單詞數(shù)

-C統(tǒng)計字節(jié)數(shù)

-m統(tǒng)計字符數(shù)

diff

ttdiff-itest,txttest2.txt〃忽略文章中的大小寫

#diff-ctest,txttest2.txt〃進行細致的比較生成一個差別表

touch

fttouchtestl.txttest2.txttest3.txt〃可以一次創(chuàng)建多個文件

mkdir

ftmkdir/export/home/wing

ftmkdir-p/export/home/wing//在路徑中名中不存在的目錄將被創(chuàng)

ttrmdirdir〃所要刪除的目錄必須是空的

rm

rm-itest,txttest2.txt//交互式刪除文件

rm-r/tem/testd〃刪除目錄和目錄下的文件

rm-ir/tem/testd〃交互式的刪除目錄和目錄下的文件

CP

cp-ioldfilenamenewfilename〃交互式拷貝

cp/export/home/keven/ok.txt/export/home/wing/test.txt

cp-ri/export/home/keven/export/home/wing整個目錄一起拷

cp-rp文件屬性一起拷貝

crontab

直接登陸窗口界面

#crontab-1root〃查看作業(yè)

/etc/init.d/cronstop〃停止進程

在CONSOLE中熟命令crontab-eroot

crontab-eroot〃編輯加入要執(zhí)行的代碼

0-59****date>>/export/home/keven/keven.txt〃加入次行

在末尾,每分鐘執(zhí)行一次

“格式如下:

(1)(2)(3)⑷(5)(6)

00**3date>>

/export/home/keven/keven.txt

1.分鐘(0-60)

2.小時(0-23)

3,日(1-31)

4.月(1-12)

5.星期(0-6)

6.所要運行的程序

如1-59分鐘,1-24小時

018-23000-6〃每天的18-23點執(zhí)行,0-6為周日到周六

/etc/init.d/cronstart〃啟動進程

#crontabTroot

查看作業(yè)是否加入執(zhí)行隊列。

不行退出到登陸界面,再次登陸進入,還加載就reboot

你是不是直接編輯用戶的cron文件呀?

如果是當(dāng)然不運行,crondemon是在啟動的時候才讀一次配置文件.

如果你是后加的JOB要用crontab-e來編輯用戶的cron.

要不你kill-HUPcron的進程ID.

重新啟動這個進程.

每5分鐘做一次必須寫成5,15,20,25,30,35,40,45,50,55****

“格式如下:

(1)(2)⑶(4)(5)(6)

00**3/usr/bin/updatedb

1.分鐘(0-60)

2.小時(0-23)

3.日(1-31)

4.月(1-⑵

5.星期(1-7)

6.所要運行的程序

但是我設(shè)成10000/usr/bin/ps

希望能自動在一分鐘之后顯示進程。但是沒有成功。

HELPME

151***/opt/bin/ta.sh/opt/aadir>/dev/null

此處》/dev/null必須用嗎?何意思?

輸出重定向到/dev/null,否則會mail到你的郵箱

dev/null是一個特殊文件,所有輸入到該文件的數(shù)據(jù)都會被丟棄。

>/dev/nun的意思就是丟棄所有的輸出內(nèi)容,否則(就象樓上老兄

說的)就會將輸出內(nèi)容發(fā)送到執(zhí)行該命令的用戶信箱中。

這種寫法只能把標準輸出送到/dev/null中,如果有錯誤產(chǎn)生的話,

還是會送到信箱里的。下面的寫法才可以丟棄所有的輸出內(nèi)容:

151***/opt/bin/ta.sh/opt/aadir>/dev/null2>&1

014**0-6//每天的下午14點執(zhí)行

Is

$Is-n

總數(shù)12

-rw-r-r—10124710月207:53list

-rw-r——r——210021006210月201:10ok.txt

drwxr-xr-x20151210月121:27ss

-rw-r-r一1100210017110月301:10test.txt

-rw-Y—r—1100210012010月220:54testl

-PW-r—r—1100210009月3008:54test2

—rw~~r—r—1100210009月3008:54test3

-rw-r-r-10124710月207:58tt.txt

#Is-Idusing_samba〃查看目錄的權(quán)限

drwxr-xr-x2rootother5125月822:23using_samba

$Is-a

..cshrclistsstestltest3

...loginok.txttest,txttest2tt.txt

$Is-1

總數(shù)12

—rw~~r—r—1rootother24710月207:53list

-rw-r--r一一2kevenuser6210月201:10ok.txt

drwxr-xr-x2rootother51210月121:27ss

—rw-r—r—1kevenuser17110月301:10test,txt

-rw-r-r-1kevenuser12010月220:54testl

-rwr—r—ikevenuser09月3008:54test2

—rw—r—r—"ikevenuser09月3008:54test3

-rw-r-r-1rootother24710月207:58tt.txt

$Is-F//列出目錄名

TTDB/keven/temp/user2/www/

cole/lost+found/userl/wing/

符號文件類型

/文件夾

*可執(zhí)行文件

(none)無格式文件或者ASCH文件

@鏈接符

如:

#Is-F

accept*gsscred*metaset*i86/〃目錄

acctadm*halt*metastat*roleadd*

adddrv*hostconfig*metasync*test.txt//ASCII

cachefslog@in.rlogind*mount*rtquery*

cachefswssizel^J接文件in.routed*mountall*rwall*〃可執(zhí)行文

$Is-R〃遞歸顯示

TT_DBkeventempuser2www

colelost+founduserlwing

./cole:

inetservices.txtservicesservices,txt

./keven:

dirtest,txt

./keven/dir:

./lost+found:

./lost+found:權(quán)限被否定

./temp:

so.tar.gz

./userl:

./user2:

./wing:

aadead,lettermywife.tarokpasswd.txttest

./wing/test:

./www:

$

$Is.〃顯示當(dāng)前目錄

dirtest.txt

$Is..〃顯示當(dāng)前目錄的父目錄,支持路徑表示符如~

TTDBkeventempuser2www

colelost+founduserlwing

$Is-itest,txttestl.txt〃節(jié)點檢查

64test.txt65testl.txt

$Is-iltest.txttestl.txt

64-rw-r一r-1kevensysadmin2710月1217:27test,txt

65-rw-r-r-1kevensysadmin010月1217:25testl.txt

$Is-Id〃只顯示目錄

drwxr-xr-x3kevensysadmin51210月1217:25.

file

$filepasswd.txt

passwd.txt:ascii文本

lp

$lpok.txtmyfiletest,txt

$lp-pevans1test,txt〃-p后為打印機evansl

$lpstat//打印隊列狀態(tài)

In

#lnfilelnewfile

#lnfileldirectory/newfilename硬鏈接

#ln~/book/chap*/home/brad

為每個chap文件都創(chuàng)建了鏈接,把這些鏈接指向/home/brad目錄

如果文件有多個指向它的硬盤鏈接,只是刪除該文件并不能有效的釋

放磁盤空間,你將不得不刪除掉所有指向它的硬鏈接。

#ln-ssrctarget

是軟鏈接,存儲的只是路徑,用1s-1可以看到,如果原文件已移

走或刪除,該名,則target就沒有用了,刪除和該名鏈接同樣用rm

如果文件有多個指向它的硬盤鏈接,只是刪除該文件并不能有效的釋

放磁盤空間,你將不得不刪除掉所有指向它的硬鏈接。

#In-s/export/home/ddd/var既把/export/home/ddd目錄鏈接

到/var下面

在var下面生成ddd鏈接符號。當(dāng)/var滿了是時候用

mv

#mv-ioldfilenamenewfilename改名文件或文件夾

#mv-isource_file(s)target_directory移動文件到其它目錄

swap

#swap-s〃列出一個系統(tǒng)虛擬交換空間的摘要。

total:25728kbytesallocated+6140kreserved=31868k

used,56496k

available

#swap-1〃列出系統(tǒng)物理交換空間的詳細說明。

swapfiledevswaploblocksfree

/dev/dsk/c0t3d0sl32,2889879290384

vmstat〃查看虛擬內(nèi)存狀態(tài)

#vmstat

kthrmemorypagediskfaultscpu

rbwswapfreeremfpipofrdesrcdfOsO-insycsus

syid

00063501240880103621010231300011628718411

99

#vmstat-s

0swapins

0swapouts

0pagesswappedin

0pagesswappedout

84899totaladdresstrans,faultstaken//地址解析錯誤

5916pageins

6pageouts

12283pagespagedin

9pagespagedout

22759totalreclaims

22759reclaimsfromfreelist

0micro(hat)faults

84899minor(as)faults//小錯誤

5186majorfaults〃主要錯誤

16092copy-on-writefaults//寫復(fù)制操作錯誤

22331zerofillpagefaults

539644pagesexaminedbytheclockdaemon

18revolutionsoftheclockhand

570pagesfreedbytheclockdaemon

550forks

17vforks

514execs

431543cpucontextswitches

272891deviceinterrupts

105553traps

671500systemcalls

97227totalnamelookups(cachehits96%)

1297usercpu

1388systemcpu

230813idlecpu

1542waitcpu

#

mpstat〃系統(tǒng)負載cpu等信息

#mpstat5〃每隔5秒刷新一次

CPUminfmjfxcalintrithrcswicswmigrsmtxsrwsysclusr

syswtidl

0322011468181501026301198

020010155160100058000100

000010155164100070000100

00009952158100048000100

02200102561641000136000100

cal

#cal

2004年5月

日一二三四五六

1

2345678

9101112131415

16171819202122

23242526272829

3031

#cal122002〃顯示2002年10月的日歷

2002年12月

日一二三四五六

1234567

891011121314

15161718192021

22232425262728

293031

#datejuname//組合命令,中間用;隔開

2004年05月19日星期三22時05分23秒CST

SunOS

重定向輸入/輸出

ftcommandfilename〃如果文件名存在,它將被覆蓋,不存在將被

創(chuàng)建

ftcommand>>filename〃向一個存在的文件追加(添加到文件的末尾)

內(nèi)容,而不是覆蓋它,如果不存在就創(chuàng)建。

ttcommand2>filename〃重定向標準錯誤,會創(chuàng)建文件或覆蓋原有文

ftcommanf2?filename〃重定向標準錯誤,向一個存在的文件追加

(添加到文件的末尾)內(nèi)容,而不是覆蓋它,如果不存在就創(chuàng)建。

建ok文件寫入:colehowareyou

$writecole<ok

cole會收到這段話:

在wing(pts/2)[10月3五22:41:08]上面的wing中的消

息...

howareyoumybaby

V結(jié)束》

find

ftfind.-nametest,txt//搜索當(dāng)前目錄

#finddir-nametest,txt

#find/-nametest.txt

#find/export/home-nametest.txt

#find?-name〃用戶的主目錄

#find/export-namecore-execrm{}\〃搜索core文件并刪除

它們

#finddir-typed//文件類型

#find/export-typed-nametest〃文件夾名為test

#find/export-size+400〃文件大于400塊的512byte=1blocks

#find/export-nametest,txt-execrm{}\;〃查找并刪除

#find/export-nametest,txt-okrm{}\;〃交互模式刪除y

#find/export-userkeven〃按用戶查找

#find/-userUID-execrm{}\;〃查找該用戶的文件并刪除

#find/-namepfile-print>find.txt2>null.txt&

〃找到則放入find,txt,否則就放到null,txt程序在后臺運行

#find/export-nametex.txt-execrm{}\;//{}、中間有一個

空格

$find?-name'*es'//es的前面為任意字符

搜索表達式意義定義

namefilename文件名搜索所有匹配的給定的文件,可以接受元字

符(如?*)

typefiletype文件類型搜索匹配給定文件類型的文件(d為目錄)

mtime[+|-]n修改的時間搜索所有修改時間或者大于,或小于給定

時間的文件

atime[+|-]n訪問的時間搜索所有訪問時間或者大于,或者小于給

定時間的文件

userloginid-groupgroupid用戶ID和屬組ID搜索所有匹配登

陸ID的所有者或?qū)俳MID的文件

permmode權(quán)限搜索所有匹配給定權(quán)限的文件(只允許八進制模式)

size[+|-]n[c]搜索所有大小或者大于,小于n的文件,n以512字節(jié)

每塊計算,如果后面有ac,則以字符(字節(jié))計算

-print基將搜索結(jié)果輸出到標準輸出。該結(jié)果是一個全路徑名的文

件名列表

-execcommand{}\;exec選項必須通過\;來終止;這樣使得find命

令可以應(yīng)用于指定命令中搜索準則中給出的每個文件

-okcommand{}\;-exec的交互格式.這個選項用于要求來自用戶的

輸入命令.如rm-i

-Is使用長列表格式打印當(dāng)前路徑.這個表達式最常用于鏈接一個輸

此把它重定向到一個文件中,以便稍后進行檢查

#greproot/etc/passwd〃在passwd中查找root

ftgrep-iroot/etc/passwd〃忽略大小寫

ftgrep-vroot/etc/passwd〃顯示除了含有root的行

#grep-crootgroup〃統(tǒng)計有多少行

10

#grep-1rootpasswdgrouphosts//查找文件中包含root的文

passwd

group

正則表達式功能例子結(jié)果

.(dot)匹配任意字符可以多次使用,類似Is命令grepchap.,file

顯示所有包含chap,且之后還有兩個字符的行

*(asterisk)在模式上匹配0個或多個字符grepchap*file顯示

所有包含chap,且之后可以是任意字符

\(backslash)告訴shell按照字面意思理解、之后的特殊字符grep

dollar、*file顯示所有包含dollar*的行./告訴shell按照字面意

思理解*,而不是通配符

(caret)匹配所有以指定模式打頭的所有行g(shù)rep"namefile顯

示所有以Name開頭的行

$匹配所有以指定模式結(jié)尾的行g(shù)rep$800file顯示所有以800結(jié)

尾的行

[]匹配模式中的一個字符grep[64.128]顯示所有包含64MB或

128MB的行

-i忽略大小寫

-v反包含.除了該字符串之外的行

egrep

#egrep'N(e|o)'/etc/passwd〃查找以字母大N開頭后面接e或

者o

listen:x:37:4:NetworkAdmin:/usr/net/nls:

nobody:x:60001:60001:Nobody:/:

noaccess:x:60002:60002:NoAccessUser:/:

nobody4:x:65534:65534:SunOS4.xNobody:/:

$egrep'(Network|uucp)Admin'/etc/passwd

uucp:x:5:5:uucpAdmin:/usr/lib/uucp:

nuucp:x:9:9:uucp

Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico

listen:x:37:4:NetworkAdmin:/usr/net/nls:

sort

#cattest,txt

oggg

aaa

ddkk

ddgfg

kk

11

34

22

ttsorttest.txt

11

22

34

aaa

ddgfg

ddkk

kk

oggg

#Is-Idt*>list

#catlist

-rw-r-r-1kevenuser3210月207:51test,txt

-rw-r—r—1kevenuser09月3008:54testl

-PW-r—r—1kevenuser09月3008:54test2

—rw~~r—r—1kevenuser09月3008:54test3

#sort-rn+4list-ott.txt〃翻轉(zhuǎn)排序頭4個字符

#Is

listok.txtsstest,txttestltest2test3tt.txt

#cattt.txt

-rw-r—r—1kevenuser3210月207:51test.txt

-rw-r-r-1kevenuser09月3008:54test3

—rw-r—r—1kevenuser09月3008:54test2

-rw-r-r-1kevenuser09月3008:54testl

#sort+5M+6nlist-oup.txt

選項描述

-n進行數(shù)字排序,n可以單獨和短橫線連接,或者可以跟著一個區(qū)

域參數(shù)

(+|-)n以第n個分隔符的區(qū)域開始或結(jié)束。默認的分割符是空格

-r翻轉(zhuǎn)排序的順序。r可以單獨與短橫線連用,或者可以跟著一個

區(qū)域參數(shù)

-f在排列中忽略大小寫

+nM把開始的三個字符做為月份名稱的簡寫來排序

-d使用字典排序,只用字母和空格排序,其它的符號忽略

-ofilename把所有輸出放到文件名中

who

#who

rootconsole10月219:23(:0)(本地登陸)

wingpts/210月219:22()(遠程登陸)

#who-q〃登陸用戶統(tǒng)計

rootwing

#users=2

#who-r〃運行級別

.run-level310月219:2030S

$who-Hu

NAMELINETIMEIDLEPIDCOMMENTS

kevenpts/210月1210:57.389()

userpts/310月1210:160:52368()

PID為用戶登陸上來的進程,#kill-9368把此用戶踢出

$who

rootconsole10月319:21(:0)

kevenpts/610月322:11()

wingpts/210月322:11()

colepts/310月322:11()

w

$w

下午11點01分運行3:43,4users,平均負載:0.00,0.00,0.02

用戶名終端號登入時間閑置JCPUPCPU執(zhí)行命令

rootconsole下午7點21分3:40101/usr/dt/bin/dtscreen

-modeblank

kevenpts/6下午10點11分-csh

wingpts/2下午10點11分5w

colepts/3下午10點11分50-ksh

$wkeven

下午H點1。分運行3:52,4users,平均負載:0.00,0.00,0.02

用戶名終端號登入時間閑置JCPUPCPU執(zhí)行命令

kevenpts/6下午10點11分9-csh

logins

#logins

root0other1Super-User

daemon1other1

bin2bin2

sys3sys3

adm4adm4Admin

uucp5uucp5uucpAdmin

nuucp9nuucp9uucpAdmin

smmsp25smmsp25SendMailMessageSubmissionProgram

listen37adm4NetworkAdmin

Ip71Ip8LinePrinterAdmin

wing1001adm4mywife

keven1002user100

userl1003adm4

user21004adm4

cole1005adm4

nobody60001nobody60001Nobody

noaccess60002noaccess60002NoAccessUser

nobody465534nogroup65534SunOS4.xNobody

last

$last〃當(dāng)前系統(tǒng)的使用歷史使用模式

kevenpts/2MonOct600:55仍在登錄狀態(tài)

colepts/6MonOct600:52仍在登錄狀態(tài)

rootconsole:0MonOct600:44仍在登錄狀態(tài)

wingpts/3MonOct600:21仍在登錄狀態(tài)

kevenpts/2MonOct600:21-00:55(00:34)

rebootsystembootMonOct600:20

kevenpts/2SunOct519:47-20:02(00:14)

rebootsystembootSunOct519:46

wingpts/1SunOct507:47—07:48(00:00)

kevenpts/1SunOct506:24-07:47(01:23)

rootconsole:0SunOct506:22-07:48(01:25)

kevenpts/1SunOct506:21-06:24(00:02)

rebootsystembootSunOct506:21

colepts/6SunOct501:58-03:09(01:11)

wingpts/5SunOct501:58—03:10(01:11)

finger

#finger

LoginNameTTYIdleWhenWhere

rootSuper-UserconsoleThu19:23:0

wingmywifepts/2Thu19:22

$finger-skeven//指定查看的用戶

LoginNameTTYIdleWhenWhere

kevenadminpts/611Fri22:11

$finger@www〃查看一臺主機的登陸用戶狀況www為主機名

[www]

LoginNameTTYIdleWhenWhere

rootSuper-Userconsole1Fri19:21:0

kevenadminpts/613Fri22:11

#finger-susername@hostname

#finger?webserver,com

#fingerusername@

$finger-1keven〃長格式顯示

Loginname:kevenInreallife:admin

Directory:/export/ho

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論