#!/bin/bash
echo "IP:"
ifconfig |grep "inet addr"|grep -v 127.0.0.1|awk '{print $2}'|awk -F ':' '{print $2}'
echo "Product Name:"
dmidecode |grep Name
echo "CPU Info:"
dmidecode |grep -i cpu|grep -i v...
分类:
其他好文 时间:
2014-09-29 14:51:31
阅读次数:
199
#!/bin/bash
IP=`awk‘{print$1}‘/home/bash/mima.txt`
foriin$IP
do
{port=`grep$i/home/bash/mima.txt|awk‘{print$2}‘`
pawd=`grep$i/home/bash/mima.txt|awk‘{print$3}‘`
expect<<EOF
spawnssh-p$portroot@$i;
expect{
"(yes/no)?"{send"yes\r"}
"password:"{send"$pa..
分类:
其他好文 时间:
2014-09-28 18:43:36
阅读次数:
133
1 内存分析1.1 jmap -histo 命令pid=`jps | awk '{if ($2 == "Jps") print $1}'`jmap -histo $pid >>1.txt 查看pid中类的内存占用num #instances(实例数) #bytes(占用字节) class name ...
分类:
其他好文 时间:
2014-09-28 18:01:53
阅读次数:
176
修改密码: passwd查看当前目录下的文件 ls查看当前用户信息 whoami*可以匹配0个或任意多个字符?可以匹配1个字符cat filename查看文件内容 cat -b filename显示行号wc统计当前文件的行数,单词数,文件大小复制文件 cp 源文件 新文件重命名 mv 原名字 新名字...
分类:
系统相关 时间:
2014-09-28 13:53:12
阅读次数:
228
Last night , I attended writting examination for Bai Du,There is a problem, ask us implement a state machine to deleting the comments in c,I don't k.....
分类:
编程语言 时间:
2014-09-27 10:43:39
阅读次数:
178
[plain]
view plaincopyprint?
#! /bin/sh while true; do i=`df -h | egrep '/mnt/yourpath'| awk '{print $5}' | cut -d "%" -f1 -`
if [ "$i" -ge 90 ] then echo "disk nearly full" cd /mnt/your...
分类:
系统相关 时间:
2014-09-27 09:35:19
阅读次数:
240
数组states[$NF],格式输出printf,注意循环结构范围{}nginx日志格式分状态码查看流量awk‘{StatesCode[$9]+=$10}END{printf("StateCode------SIZE(bytes)\n");for(iinStatesCode)printf("%8s%18s\n",i,StatesCode[i])}‘access.log
分类:
其他好文 时间:
2014-09-26 20:37:59
阅读次数:
127
#!/bin/awk-f
#Function:指定使用文件中随机数量的行(手动传参ipl和idl)随机替换指定列(脚本中指定);使用指定位数的随机浮点替换指定列(脚本中指定)。
#Usage:./t.awk-vip=<ipfile>-vid=<idfile>-vipl=<n>-vidl=<n>log.txt
#Date:2014092220:16
BEGIN..
分类:
其他好文 时间:
2014-09-26 20:26:39
阅读次数:
176