cut截取cut-d:-f+数字+文件取文件的第几段,多个数字之间加逗号cut-c截取第几个字符(3-53到5个)sort排序-t分隔符-u去重复-n以数字排序-k几段(-k3,5---3到5段)sort-t:-k3-n/etc/passwd//以第3段的数字排序,加r反序排wc求行数-l-----求行数-w-----多少个单词(以空白分隔)-m-----字..
分类:
系统相关 时间:
2016-06-09 01:03:41
阅读次数:
332
shell脚本中的循环for循环语法结构:for变量名in条件;do…done例:#!/bin/bashsum=0foriin`seq1100`dosum=$[$sum+$i]echo$idoneecho$sum例:#!/bin/bashcd/etc/forain`ls/etc/`doif[-d$a]thenls-d$afidone例:#!/bin/bashn=`wc-l1.txt|awk‘{print$1}‘`foriin`seq1$n`dosed-n"$i"p1...
分类:
其他好文 时间:
2016-06-09 01:01:00
阅读次数:
182
1. 在客户端上创建脚本/usr/local/nagios/libexec/check_disk.shvim /usr/local/nagios/libexec/check_disk.sh 写入如下内容:(client上)#!/bin/bash#!/bin/bashrow=`df -h |wc -l ...
分类:
移动开发 时间:
2016-06-08 15:19:07
阅读次数:
274
for i in `seq 1 $(cat /proc/cpuinfo |grep "physical id" |wc -l)`; do dd if=/dev/zero of=/dev/null & done 说明: cat /proc/cpuinfo |grep "physical id" | w ...
分类:
系统相关 时间:
2016-06-03 18:42:22
阅读次数:
282
1.查找当前目录中所有大于500M的文件,把这些文件名写到一个文本文件中,并统计其个数。find ./ -size +500M -type f | tee file_list | wc -l2.在目录/tmp下找到100个以abc开头的文件,然后把这些文件的第一行保存到文件new中。for file ...
分类:
系统相关 时间:
2016-06-02 17:53:45
阅读次数:
293
1、查看系统负载命令 w命令:主要查看cpu负载 load average:一分钟内负载 五分钟内负载 十五分钟内负载 负载跟cpu核心数有关,查看cpu核心数: # cat /proc/cpuinfo | grep 'processor' | wc -l uptime也可以显示cpu负载 2、vm ...
分类:
系统相关 时间:
2016-06-02 11:18:17
阅读次数:
239
Linux系统中的wc(Word Count)命令的功能为统计指定文件中的字节数、字数、行数,并将统计结果显示输出。 (1)用法: 用法: wc [选项] [文件]...... (2)功能: 功能: wc命令用来计算数字。利用wc指令我们可以计算文件的Byte数、字数或是列数,若不指定文件名称,或是 ...
分类:
系统相关 时间:
2016-06-02 08:31:09
阅读次数:
228
# 总核数 = 物理CPU个数 X 每颗物理CPU的核数 # 总逻辑CPU数 = 物理CPU个数 X 每颗物理CPU的核数 X 超线程数 # 查看物理CPU个数cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l # 查看每个物理CPU中c ...
分类:
其他好文 时间:
2016-06-01 19:43:07
阅读次数:
123
Description Input Output Sample Input Sample Output HINT 线段树套并查集应该是比较好写的做法,时间复杂度为O(N^3+M*NlogN)。 #include<cstdio> #include<cctype> #include<queue> #in ...
分类:
其他好文 时间:
2016-05-31 20:48:10
阅读次数:
168
if[$(rpm-qa|grepopenssl|wc-l)-lt1];thenyum-yinstallopensslopenssl-develfiif[$(rpm-qa|grepsasl|wc-l)-lt1];thenyum-yinstallcyrus-sasl-*fiif[-z$(ps-ef|grepsasl|grep-vgrep)];then/etc/init.d/saslauthdstartchkconfigsaslauthdonficd~wgetftp://ftp.mutt.org/pub/mutt/..
分类:
其他好文 时间:
2016-05-30 17:23:10
阅读次数:
197