Solaris下的常用命令和使用方法(转)

Solaris下的常用命令和使用方法(转)

  终端控制

  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 //递归显示

  .:

  

本文来自:http://www.linuxpk.com/40371.html

--&gtlinux电子图书免费下载和技术讨论基地

·上一篇: Linux系统命令精通指南(初级)

·下一篇: 提高工作效率设置命令提示符下的热键
 
     最新更新
·Linux指令篇:终端机管理--clear

·Linux基础系列教程

·将.c文件更名时使用的完美脚本

·详解Bash命令行处理

·RPM常用命令及RPM中文手册

·Linux的kill命令与信号控制

·Linux文件查找命令find,xargs详述

·Linux下的编辑器——vi大全

·常用命令之make常见规则解析

·另类技术:怎样显示一个字呢?

·软件安装之--RPM命令大全

·vi中将逗号和回车互换的技巧

·Linux指令篇:档案目录管理--rmdir

·Linux指令篇:档案目录管理--split

·Linux指令篇:档案目录管理--touch

·Linux指令篇:档案目录管理--rm

·Rpm命令手册

·Linux指令篇:日期时间排程--at

·Linux指令篇:日期时间排程--cal

·Linux指令篇:日期时间排程--crontab

·Linux指令篇:日期时间排程--date

·Linux指令篇:日期时间排程--sleep

·Linux指令篇:日期时间排程--time

·Linux指令篇:档案目录管理--mv

·Linux指令篇:档案目录管理--more

·Linux指令篇:档案目录管理--mkdir

·Linux指令篇:档案目录管理--cat

·Linux指令篇:档案目录管理--cd

·Linux指令篇:档案目录管理--chmod

·Linux指令篇:档案目录管理--chown


关于我们 | 联系方式 | 广告合作 | 诚聘英才 | 网站地图 | 网址大全 | 友情链接 | 免费注册

Copyright © 2004 - 2007 All Rights Reserved

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14102/viewspace-117257/,如需转载,请注明出处,否则将追究法律责任。

user_pic_default.png
请登录后发表评论 登录
全部评论
<%=items[i].createtime%>

<%=items[i].content%>

<%if(items[i].items.items.length) { %>
<%for(var j=0;j
<%=items[i].items.items[j].createtime%> 回复

<%=items[i].items.items[j].username%>   回复   <%=items[i].items.items[j].tousername%><%=items[i].items.items[j].content%>

<%}%> <%if(items[i].items.total > 5) { %>
还有<%=items[i].items.total-5%>条评论 ) data-count=1 data-flag=true>点击查看
<%}%>
<%}%> <%}%>

转载于:http://blog.itpub.net/14102/viewspace-117257/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值