随笔分类 -  linux

linux系统
摘要:查看文档/etc/passwd 文档并删除2,5行[root@localhost yaotameng]# nl /etc/passwd |sed '2,5d' 1 root:x:0:0:root:/root:/bin/bash 6 sync:x:5:0:sync:/sbin:/bin/sync 7 shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 8 halt:x:7:0:halt:/sbin:/sbin/halt 9 mail:x:8:12:mail:/var/spool/mail:/sbin/nolo... 阅读全文
posted @ 2013-04-16 16:58 冬之夜 阅读(194) 评论(0) 推荐(0)
摘要:1.搜索特定字符串[root@localhost ~]# grep 'the' anaconda-ks.cfg (在anaconda-ks.cfg中查找包含the的行)[root@localhost ~]# grep -n 'the' anaconda-ks.cfg (-n显示行号)反选,即不包含the的行[root@localhost ~]# grep -vn 'the' anaconda-ks.cfg取得不分大小写的the[root@localhost ~]# grep -in 'the' anaconda-ks.cfg2.[ 阅读全文
posted @ 2013-04-10 17:11 冬之夜 阅读(182) 评论(0) 推荐(0)
摘要:变量定义的基本规则:1.变量名和变量内容以一个“=”来连接 如 myname=zhangsan2.等号两边不能直接接空格,如下为错误的myname = zhangsan 或者 myname=zhang san3.变量名可以为字母或数字,但不能以数字开头,如下是错误的2myname=zhangsan4.变量内容有空格可以使用“”双引号或者‘’单引号将变量内容结合起来,但双引号内的特殊字符如$等,可以保留原有特性单引号内的特殊字符仅为一般内容,纯文本 如[root@www ~]# name=VBird [root@www ~]# echo $name VBird [root@www ~... 阅读全文
posted @ 2013-04-08 09:47 冬之夜 阅读(668) 评论(0) 推荐(0)
摘要:free命令详解[root@localhost ~]# free total used free shared buffers cachedMem: 1016672 152640 864032 0 12536 40168-/+ buffers/cache: 99936 916736Swap: 1023992 0 1023992 -buffers/cache:等于第1行的(used-buffers-ca... 阅读全文
posted @ 2013-03-27 10:53 冬之夜 阅读(202) 评论(0) 推荐(0)
摘要:在监控系统资源的时候要关闭防火墙,否则会出现以下错误:Monitor name :UNIX Resources. Cannot initialize the monitoring on 192.168.136.143. Error while creating the RPC client. Ensure that the machine can be connected and that it runs the rstat daemon (use rpcinfo utility for this verification). Detailed error: RPC: Failed to cr 阅读全文
posted @ 2013-03-26 10:24 冬之夜 阅读(170) 评论(0) 推荐(0)
摘要:时间服务器配置(192.168.10.1)1). # rpm -ivh ntp-4.1.2-4.EL3.1.i386.rpm2). # vi /etc/ntp.conf注释一行restrict default ignore加入一行restrict 192.168.10.0 mask 255.255.255.0 notrust nomodify notrap3). # vi /etc/ntp/step-tickers加入一行pool.ntp.org这样每次ntpd启动时,会自动连接该国际标准时间服务器;4). # service ntpd start5). # netstat -an |grep 阅读全文
posted @ 2013-03-25 10:47 冬之夜 阅读(141) 评论(0) 推荐(0)