为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

Solaris10常用命令-例子

2019-05-28 12页 doc 29KB 18阅读

用户头像

is_153723

暂无简介

举报
Solaris10常用命令-例子Solaris常用命令和例子 1) ok>probe-ide                          //Ultra5/10、Blade100/150 ok>probe-scsi-all                        //Ultra60、E450、V480 ok probe-scsi-all /pci@1f,4000/scsi@3,1 /pci@1f,4000/scsi@3 Target 0 Unit 0 Disk QUANTUM VK4550J SUN4.2G8817 Target 6  Un...
Solaris10常用命令-例子
Solaris常用命令和例子 1) ok>probe-ide                          //Ultra5/10、Blade100/150 ok>probe-scsi-all                        //Ultra60、E450、V480 ok probe-scsi-all /pci@1f,4000/scsi@3,1 /pci@1f,4000/scsi@3 Target 0 Unit 0 Disk QUANTUM VK4550J SUN4.2G8817 Target 6  Unit 0 Removable Read Only device TOSHIBA 2395 XM5701TASUN12XCD fsck 例: ok boot Boot path: /ssm@0,0/pci@1c,700000/pci@1/SUNW,isptwo@4/sd@0,0:a  Boot args: -s Loading ufs-file-system package 1.4 04 Aug 1995 13:02:54. FCode UFS Reader 1.11 97/07/10 16:19:15. Loading: /platform/SUNW,Sun-Fire/ufsboot Loading: /platform/sun4u/ufsboot SunOS Release 5.8 Version Generic_110096-04 64-bit Copyright 1983-2000 Sun Microsystems, Inc.  All rights reserved. WARNING: todsg_get(): TOD SRAM magic error WARNING: todsg_get(): turned off using tod configuring IPv4 interfaces: hme1. Hostname: qame-a The / file system (/dev/rdsk/c4t0d0s0) is being checked. /dev/rdsk/c4t0d0s0: INCORRECT BLOCK COUNT I=50905 (4 should be 0) (CORRECTED) /dev/rdsk/c4t0d0s0: INCORRECT BLOCK COUNT I=50906 (2 should be 0) (CORRECTED) /dev/rdsk/c4t0d0s0: INCORRECT BLOCK COUNT I=50907 (2 should be 0) (CORRECTED) /dev/rdsk/c4t0d0s0: INCORRECT BLOCK COUNT I=539350 (18 should be 0) (CORRECTED) /dev/rdsk/c4t0d0s0: INCORRECT BLOCK COUNT I=539351 (2 should be 0) (CORRECTED) /dev/rdsk/c4t0d0s0: INCORRECT BLOCK COUNT I=753040 (2 should be 0) (CORRECTED) /dev/rdsk/c4t0d0s0: INCORRECT BLOCK COUNT I=804088 (2 should be 0) (CORRECTED) /dev/rdsk/c4t0d0s0: INCORRECT BLOCK COUNT I=881943 (2 should be 0) (CORRECTED) /dev/rdsk/c4t0d0s0: INCORRECT BLOCK COUNT I=881944 (2 should be 0) (CORRECTED) /dev/rdsk/c4t0d0s0: INCORRECT BLOCK COUNT I=885317 (6 should be 0) (CORRECTED) /dev/rdsk/c4t0d0s0: 7499747 DUP I=885355 /dev/rdsk/c4t0d0s0: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. WARNING - Unable to repair the / filesystem. Run fsck manually (fsck -F ufs /dev/rdsk/c4t0d0s0). Exit the shell when done to continue the boot process. Type control-d to proceed with normal startup, (or give root password for system maintenance): #fsck –y ok boot cdrom –s #fsck –y /dev/rdsk/c0t0d0s0 2) 终端控制 ctrl+s :终止屏幕输出,如用cat命令输出时,要停一下 ctrl+q :恢复ctrl+q的输出 ctrl+c :中断当前的活动,返回命令提示符 ctrl+d :示文件的结束或退出,如退出终端窗口 ctrl+u :擦除整个命令行 ctrl+w :擦除命令行最后一个单词 ctrl+h :擦除命令行最后一个字符 3) # uname –a                      //查看操作系统版本以及内核版本 SunOS 5.7 Generic_106541-19 sun4u sparc sun4u SunOS: OS5.5.1=solaris2.5.1 OS5.6=solaris2.6 OS5.7=solaris7 OS5.8=solaris8 Unix kernel: 32 bit SPARC - /platform/sun4u/kernel/unix 64 bit SPARC - /platform/sun4u/kernel/sparcv9/unix intel        - /platform/i86pc/kernel/unix 4) # date  # date mmddHHMM[[cc]yy][.SS] # date 2003年10月12日 星期日 10时04分16秒 CST (CST是Chinese Standard Time的缩写) # date 10121003  设置时间为10月12日10时03分 5) #stings  #stings /usr/bin/cat 能够用来打印可执行文件或二进制文件中的可读字符。 6) 常用文本文件的命令 #cat -n test.txt             //显示行号 #more test.txt | more 键值 目的 空格 滚动到下一屏 回车 一次滚动一行 b 向后移动一屏 f 向前移动一屏 h 显示更多特性的帮助菜单 q 退出,返回shell提示符 /string 向前搜索字符串string n 查找下一处匹配 head #head -5 /export/home/wing/test.txt  //显示开始的5行 #head chap*|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入口 Oct  6 00:20:26 wing genunix: [ID 936769 kern.info] sd0 is /pci@0,0/pci-ide@7,1/ide@1/sd@0,0 Oct  6 00:20:26 wing pcplusmp: [ID 637496 kern.info] pcplusmp: fdc (fdc) instance 0 vector 0x6 ioapi c 0x1 intin 0x6 is bound to cpu 0 Oct  6 00:20:26 wing last message repeated 1 time Oct  6 00:20:26 wing isa: [ID 202937 kern.info] ISA-device: fdc0 Oct  6 00:20:26 wing fdc: [ID 114370 kern.info] fd0 at fdc0 Oct  6 00:20:26 wing genunix: [ID 936769 kern.info] fd0 is /isa/fdc@1,3f0/fd@0,0 Oct  6 00:20:30 wing i8042: [ID 526150 kern.info] 8042 device:  mouse@1, mouse8042 # 0 Oct  6 00:20:30 wing genunix: [ID 936769 kern.info] mouse80420 is /isa/i8042@1,60/mouse@1 Oct  6 00:21:37 wing login: [ID 722452 auth.error] user2netname: (nis+ lookup): Error in accessing N IS+ cold start file... is NIS+ installed? Oct  6 00:21:47 wing last message repeated 1 time Oct  6 00:52:07 wing login: [ID 722452 auth.error] user2netname: (nis+ lookup): Error in accessing N IS+ cold start file... is NIS+ installed? wc #wc /export/home/wing/test.txt    //显示文件的行、单词、字节数 #wc -l /export/home/wing/test.txt   //显示文件的行数 选项 功能 -l 统计行数 -w 统计单词数 -c 统计字节数 -m 统计字符数 diff #diff -i test.txt test2.txt         //忽略文章中的大小写 #diff -c test.txt test2.txt        //进行细致的比较生成一个差别表 8)常用文件和文件夹操作命令: touch  #touch test1.txt test2.txt test3.txt    //可以一次创建多个文件 mkdir #mkdir /export/home/wing #mkdir -p /export/home/wing //在路径中名中不存在的目录将被创建 #rmdir dir   //所要删除的目录必须是空的 rm rm -i  test.txt test2.txt  //交互式删除文件 rm -r  /tem/testd   //删除目录和目录下的文件 rm -ir /tem/testd  //交互式的删除目录和目录下的文件 cp cp -i  oldfilename newfilename   //交互式拷贝 cp /export/home/keven/ok.txt /export/home/wing/test.txt cp -ri /export/home/keven /export/home/wing  整个目录一起拷 cp -rp  文件属性一起拷贝 ls $ ls -n 总数 12 -rw-r--r--   1 0        1            247 10月  2 07:53 list -rw-r--r--   2 1002     100           62 10月  2 01:10 ok.txt drwxr-xr-x   2 0        1            512 10月  1 21:27 ss -rw-r--r--   1 1002     100          171 10月  3 01:10 test.txt -rw-r--r--   1 1002     100          120 10月  2 20:54 test1 -rw-r--r--   1 1002     100            0  9月 30 08:54 test2 -rw-r--r--   1 1002     100            0  9月 30 08:54 test3 -rw-r--r--   1 0        1            247 10月  2 07:58 tt.txt # ls -ld using_samba    //查看目录的权限 drwxr-xr-x   2 root     other        512  5月  8 22:23 using_samba $ ls -a .         .cshrc    list      ss        test1     test3 ..        .login    ok.txt    test.txt  test2     tt.txt $ ls -l 总数 12 -rw-r--r--   1 root     other        247 10月  2 07:53 list -rw-r--r--   2 keven    user          62 10月  2 01:10 ok.txt drwxr-xr-x   2 root     other        512 10月  1 21:27 ss -rw-r--r--   1 keven    user         171 10月  3 01:10 test.txt -rw-r--r--   1 keven    user         120 10月  2 20:54 test1 -rw-r--r--   1 keven    user           0  9月 30 08:54 test2 -rw-r--r--   1 keven    user           0  9月 30 08:54 test3 -rw-r--r--   1 root     other        247 10月  2 07:58 tt.txt $ ls -F    //列出目录名 TT_DB/       keven/       temp/        user2/       www/ cole/        lost+found/  user1/       wing/ 符号 文件类型 / 文件夹 * 可执行文件 (none) 无格式文件或者ASCII文件 @ 链接符 如: # ls -F accept*           gsscred*          metaset*           i86/  //目录 acctadm*          halt*             metastat*         roleadd* add_drv*          hostconfig*       metasync*         test.txt  //ASCII cachefslog@       in.rlogind*       mount*            rtquery* cachefswssize@链接文件    in.routed*        mountall*         rwall*//可执行文件 $ ls -R   //递归显示 .: TT_DB       keven       temp        user2       www cole        lost+found  user1       wing ./cole: inetservices.txt  services          services.txt ./keven: dir       test.txt ./keven/dir: ./lost+found: ./lost+found: 权限被否定 ./temp: so.tar.gz ./user1: ./user2: ./wing: aa           dead.letter  mywife.tar   ok           passwd.txt   test ./wing/test: ./www: $ $ ls .    //显示当前目录 dir       test.txt $ ls ..   //显示当前目录的父目录,支持路径表示符如~ TT_DB       keven       temp        user2       www cole        lost+found  user1       wing $ ls -i test.txt test1.txt  //节点检查 64 test.txt           65 test1.txt $ ls -il test.txt test1.txt 64 -rw-r--r--   1 keven    sysadmin      27 10月 12 17:27 test.txt 65 -rw-r--r--   1 keven    sysadmin       0 10月 12 17:25 test1.txt $ ls -ld     //只显示目录 drwxr-xr-x   3 keven    sysadmin     512 10月 12 17:25 . file $ file passwd.txt passwd.txt:     ascii文本 lp $lp ok.txt myfile test.txt $lp -p evans1 test.txt     //-p后为打印机evans1 $lpstat    // 打印队列状态
/
本文档为【Solaris10常用命令-例子】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索