当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: 如题 lcqxmu 回复于:2004
 

 

    摘要: solstice disksuite location of components ---------------------- [color=blue:3262023abf][b:3262023abf]command line utilities in /usr/opt/sunwmd/sbin driver modules in /kernel/drv and /kernel/mis......
 ·solaris9    »显示摘要«
    摘要: software packages needed: 1. gcc 3.2.3 compiled package for x86 platform: gcc-3.2.3-sol9-intel-local.gz 2. mysql 3.23.55 source code package: mysql-3.23.55.tar.gz 3. apache 2.0.44 source co......


请问哪有Solaris的中文命令参考手册?

如题 【程序编程相关:转载:我的 Solaris Server

【推荐阅读:Sun OS command

【扩展信息:哪里可以查到Solaris(sparc)

 lcqxmu 回复于:2004-06-28 09:22:58 到精华区里去找找

会有的

 cole 回复于:2004-06-28 10:11:36 ok>show-devs 

ok>show-disks

终端控制

ctrl+s :终止屏幕输出,如用cat命令输出时,要停一下

ctrl+q :恢复ctrl+q的输出

ctrl+c :中断当前的活动,返回命令提示符

ctrl+d :表示文件的结束或退出,如退出终端窗口

ctrl+u :擦除整个命令行

ctrl+w :擦除命令行最后一个单词

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

bc :计算器

#ksh 切换到k shell

   

命令:

# uname

sunos

name

#man uname

     uname - print name of current system

synopsis

     uname [-aimnprsvx]

     uname [-s system_name]

# date

2004年05月19日 星期三 21时57分49秒 cst

stings 

$stings /usr/bin/cat

 能够用来打印可执行文件或二进制文件中的可读字符.

cat  more

  

#cat -n test.txt             //显示行号

键值 目的

空格 滚动到下一屏

回车 一次滚动一行

b 向后移动一屏

f 向前移动一屏

h 显示更多特性的帮助菜单

q 退出,返回shell提示符

/string 向前搜索字符串string

n 查找下一处匹配

less

#less test.txt      //前移动一屏f,后b ,/string   查找字符

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        //进行细致的比较生成一个差别表

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  文件属性一起拷贝

crontab

直接登陆窗口界面

# crontab -l root   //查看作业

/etc/init.d/cron stop    //停止进程

在console 中熟命令 crontab -e root

crontab -e root     //编辑加入要执行的代码

0-59 * * * * date >> /export/home/keven/keven.txt //加入次行在末尾,每分钟执行一次

“格式如下: 

  (1)  (2)  (3)  (4)  (5)  (6) 

   0   0   *   *   3   date >> /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 小时

0 18-23 0 0  0-6   //每天的18-23点执行,0-6为周日到周六

/etc/init.d/cron start  //启动进程

# crontab -l root  

查看作业是否加入执行队列.

不行退出到登陆界面,再次登陆进入,还加载就reboot

你是不是直接编辑用户的cron文件呀? 

如果是当然不运行,cron demon是在启动的时候才读一次配置文件. 

如果你是后加的job 要用crontab -e来编辑用户的cron. 

要不你 kill -hup cron的进程id. 

重新启动这个进程.

每5分钟做一次必须写成5,15,20,25,30,35,40,45,50,55 * * * *

===================================

“格式如下: 

  (1)  (2)  (3)  (4)  (5)  (6) 

   0   0   *   *   3   /usr/bin/updatedb 

      1. 分钟 (0-60) 

      2. 小时 (0-23) 

      3. 日 (1-31) 

      4. 月 (1-12) 

      5. 星期 (1-7) 

      6. 所要运行的程序 

但是我设成 1 0 0 0 0 /usr/bin/ps 

希望能自动在一分钟之后显示进程.但是没有成功. 

help me

===============================================

15 1 * * * /opt/bin/ta.sh /opt/aadir > /dev/null 

此处>/dev/null 必须用吗? 何意思?

输出重定向到/dev/null, 否则会mail到你的邮箱

dev/null 是一个特殊文件,所有输入到该文件的数据都会被丢弃. 

> /dev/null 的意思就是丢弃所有的输出内容,否则(就象楼上老兄说的)就会将输出内容发送到执行该命令的用户信箱中.

这种写法只能把标准输出送到/dev/null中,如果有错误产生的话,还是会送到信箱里的.下面的写法才可以丢弃所有的输出内容: 

15 1 * * * /opt/bin/ta.sh /opt/aadir > /dev/null 2>&1

0 14 * * 0-6  //每天的下午14点执行

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    // 打印队列状态

ln

#ln file1 newfile 

#ln file1 directory/newfilename  硬链接

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

为每个chap文件都创建了链接,把这些链接指向/home/brad目录

如果文件有多个指向它的硬盘链接,只是删除该文件并不能有效的释放磁盘空间,你将不得不删除掉所有指向它的硬链接.

#ln -s src target  

是软链接,存储的只是路径,用ls -l 可以看到,如果原文件已移走或删除,该名,则target就没有用了,删除与该名链接同样用rm

如果文件有多个指向它的硬盘链接,只是删除该文件并不能有效的释放磁盘空间,你将不得不删除掉所有指向它的硬链接.

# ln -s /export/home/ddd  /var   既把/export/home/ddd目录链接到/var下面

在var下面生成ddd 链接符号.当/var满了是时候用

mv

#mv -i oldfilename newfilename 改名文件或文件夹

#mv -i source_file(s)  target_directory   移动文件到其它目录

 swap              

# swap -s      //列出一个系统虚拟交换空间的摘要.

total: 25728k bytes allocated + 6140k reserved = 31868k used,56496k

available

                            

# swap -l     //列出系统物理交换空间的详细说明.

swapfile              dev      swaplo      blocks      free

/dev/dsk/c0t3d0s1   32,28        8        98792       90384

vmstat  //查看虚拟内存状态

# vmstat

 kthr      memory            page            disk          faults      cpu

 r b w   swap  free  re  mf pi po fr de sr cd f0 s0 --   in   sy   cs us sy id


...   下一页
 ·vxvm rootdisk 封装和解除封装    »显示摘要«
    摘要: 环境:ultra1 2块硬盘 已经配置rootdg内包含一个slice c0t0d0s5 系统盘上的slice 5 6 7 各有100m空间 其余空间都给了/ 和swap 试验内容为将根盘封装,然后景象。试验景象盘能够引导系统,最后解除景象和封装。 rootdisk encapsulate 1.add new disk slice at rootdg root@sunlab # vxdctl......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE