您好,欢迎访问三七文档
当前位置:首页 > 机械/制造/汽车 > 综合/其它 > Solaris常用命令和例子
Solaris常用命令和例子1)okprobe-ide//Ultra5/10、Blade100/150okprobe-scsi-all//Ultra60、E450、V480okprobe-scsi-all/pci@1f,4000/scsi@3,1/pci@1f,4000/scsi@3Target0Unit0DiskQUANTUMVK4550JSUN4.2G8817Target6Unit0RemovableReadOnlydeviceTOSHIBA2395XM5701TASUN12XCDfsck例:okbootBootpath:/ssm@0,0/pci@1c,700000/pci@1/SUNW,isptwo@4/sd@0,0:aBootargs:-sLoadingufs-file-systempackage1.404Aug199513:02:54.FCodeUFSReader1.1197/07/1016:19:15.Loading:/platform/SUNW,Sun-Fire/ufsbootLoading:/platform/sun4u/ufsbootSunOSRelease5.8VersionGeneric_110096-0464-bitCopyright1983-2000SunMicrosystems,Inc.Allrightsreserved.WARNING:todsg_get():TODSRAMmagicerrorWARNING:todsg_get():turnedoffusingtodconfiguringIPv4interfaces:hme1.Hostname:qame-aThe/filesystem(/dev/rdsk/c4t0d0s0)isbeingchecked./dev/rdsk/c4t0d0s0:INCORRECTBLOCKCOUNTI=50905(4shouldbe0)(CORRECTED)/dev/rdsk/c4t0d0s0:INCORRECTBLOCKCOUNTI=50906(2shouldbe0)(CORRECTED)/dev/rdsk/c4t0d0s0:INCORRECTBLOCKCOUNTI=50907(2shouldbe0)(CORRECTED)/dev/rdsk/c4t0d0s0:INCORRECTBLOCKCOUNTI=539350(18shouldbe0)(CORRECTED)/dev/rdsk/c4t0d0s0:INCORRECTBLOCKCOUNTI=539351(2shouldbe0)(CORRECTED)/dev/rdsk/c4t0d0s0:INCORRECTBLOCKCOUNTI=753040(2shouldbe0)(CORRECTED)/dev/rdsk/c4t0d0s0:INCORRECTBLOCKCOUNTI=804088(2shouldbe0)(CORRECTED)/dev/rdsk/c4t0d0s0:INCORRECTBLOCKCOUNTI=881943(2shouldbe0)(CORRECTED)/dev/rdsk/c4t0d0s0:INCORRECTBLOCKCOUNTI=881944(2shouldbe0)(CORRECTED)/dev/rdsk/c4t0d0s0:INCORRECTBLOCKCOUNTI=885317(6shouldbe0)(CORRECTED)/dev/rdsk/c4t0d0s0:7499747DUPI=885355/dev/rdsk/c4t0d0s0:UNEXPECTEDINCONSISTENCY;RUNfsckMANUALLY.WARNING-Unabletorepairthe/filesystem.Runfsckmanually(fsck-Fufs/dev/rdsk/c4t0d0s0).Exittheshellwhendonetocontinuethebootprocess.Typecontrol-dtoproceedwithnormalstartup,(orgiverootpasswordforsystemmaintenance):#fsck–yokbootcdrom–s#fsck–y/dev/rdsk/c0t0d0s02)终端控制ctrl+s:终止屏幕输出,如用cat命令输出时,要停一下ctrl+q:恢复ctrl+q的输出ctrl+c:中断当前的活动,返回命令提示符ctrl+d:表示文件的结束或退出,如退出终端窗口ctrl+u:擦除整个命令行ctrl+w:擦除命令行最后一个单词ctrl+h:擦除命令行最后一个字符3)#uname–a//查看操作系统版本以及内核版本SunOShostname5.7Generic_106541-19sun4usparcsun4uSunOS:OS5.5.1=solaris2.5.1OS5.6=solaris2.6OS5.7=solaris7OS5.8=solaris8Unixkernel:32bitSPARC-/platform/sun4u/kernel/unix64bitSPARC-/platform/sun4u/kernel/sparcv9/unixintel-/platform/i86pc/kernel/unix4)#date#datemmddHHMM[[cc]yy][.SS]#date2003年10月12日星期日10时04分16秒CST(CST是ChineseStandardTime的缩写)#date10121003设置时间为10月12日10时03分5)#stings#stings/usr/bin/cat能够用来打印可执行文件或二进制文件中的可读字符。6)常用文本文件的命令#cat-ntest.txt//显示行号#moretest.txt|more键值目的空格滚动到下一屏回车一次滚动一行b向后移动一屏f向前移动一屏h显示更多特性的帮助菜单q退出,返回shell提示符/string向前搜索字符串stringn查找下一处匹配head#head-5/export/home/wing/test.txt//显示开始的5行#headchap*|more//显示所有以chap开头的文件的头部用来显示一个或多个文件的前n行,默认省略-n参数将显示文件的前10行。tail#tail-5/export/home/wing/test.txt//显示最后5行#tail+5/export/home/wing/test.txt//显示第5行开始到结束用来显示一个文件的最后n行,默认省略-n参数将显示文件的最后10行。#tail-f/var/adm/messages//实时自动浏览syslog入口Oct600:20:26winggenunix:[ID936769kern.info]sd0is/pci@0,0/pci-ide@7,1/ide@1/sd@0,0Oct600:20:26wingpcplusmp:[ID637496kern.info]pcplusmp:fdc(fdc)instance0vector0x6ioapic0x1intin0x6isboundtocpu0Oct600:20:26winglastmessagerepeated1timeOct600:20:26wingisa:[ID202937kern.info]ISA-device:fdc0Oct600:20:26wingfdc:[ID114370kern.info]fd0atfdc0Oct600:20:26winggenunix:[ID936769kern.info]fd0is/isa/fdc@1,3f0/fd@0,0Oct600:20:30wingi8042:[ID526150kern.info]8042device:mouse@1,mouse8042#0Oct600:20:30winggenunix:[ID936769kern.info]mouse80420is/isa/i8042@1,60/mouse@1Oct600:21:37winglogin:[ID722452auth.error]user2netname:(nis+lookup):ErrorinaccessingNIS+coldstartfile...isNIS+installed?Oct600:21:47winglastmessagerepeated1timeOct600:52:07winglogin:[ID722452auth.error]user2netname:(nis+lookup):ErrorinaccessingNIS+coldstartfile...isNIS+installed?wc#wc/export/home/wing/test.txt//显示文件的行、单词、字节数#wc-l/export/home/wing/test.txt//显示文件的行数选项功能-l统计行数-w统计单词数-c统计字节数-m统计字符数diff#diff-itest.txttest2.txt//忽略文章中的大小写#diff-ctest.txttest2.txt//进行细致的比较生成一个差别表8)常用文件和文件夹操作命令:touch#touchtest1.txttest2.txttest3.txt//可以一次创建多个文件mkdir#mkdir/export/home/wing#mkdir-p/export/home/wing//在路径中名中不存在的目录将被创建#rmdirdir//所要删除的目录必须是空的rmrm-itest.txttest2.txt//交互式删除文件rm-r/tem/testd//删除目录和目录下的文件rm-ir/tem/testd//交互式的删除目录和目录下的文件cpcp-ioldfilenamenewfilename//交互式拷贝cp/export/home/keven/ok.txt/export/home/wing/test.txtcp-ri/export/home/keven/export/home/wing整个目录一起拷cp-rp文件属性一起拷贝ls$ls-n总数12-rw-r--r--10124710月207:53list-rw-r--r--210021006210月201:10ok.txtdrwxr-xr-x20151210月121:27ss-rw-r--r--1100210017110月301:10test.txt-rw-r--r--1100210012010月220:54test1-rw-r--r--1100210009月3008:54test2-rw-r--r--1100210009月3008:54test3-rw-r--r--10124710月207:58tt.txt#ls-ldusing_samba//查看目录的权限drwxr-xr-x2rootother5125月822:23using_samba$ls-a..cshrclistsstest1test3...loginok.txttest.txttest2tt.txt$ls-l总数12-rw-r--r--1rootother24710月207:53list-rw-r--r--2kevenuser6210月201:10ok.txtdrwxr-xr-x2rootother51210月121:27ss-rw-r--r--1kevenuser17110月301:10test.txt-rw-r--r--1kevenuser12010月220:54test1-rw-r--r--1kevenuser09月3008:54test2-rw-r--r--1kevenuser09月3008:54test3-rw-r--r--1rootother24710月207:58tt.txt$ls-F//列出目录名TT_DB/keven/temp/user2/符号
本文标题:Solaris常用命令和例子
链接地址:https://www.777doc.com/doc-6016871 .html