自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Acura

Shell Awk Sed

  • 博客(21)
  • 资源 (4)
  • 收藏
  • 关注

转载 HTTP状态码

如果向您的服务器发出了某项请求要求显示您网站上的某个网页(例如,当用户通过浏览器访问您的网页或在 Googlebot 抓取该网页时),那么,您的服务器会返回 HTTP 状态代码以响应该请求。此状态代码提供了有关请求状态的信息,且为 Googlebot 提供了有关您网站和请求的网页的信息。一些常见的状态代码为:200 – 服务器成功返回网页404 – 请求的网页不存在503 – 服务

2012-03-04 11:50:40 277

转载 mysql之skip-name-resolve

今天安装了个Mysql5.5.4版本的,重启测试时发现Error.log有下面提示:100616 21:05:15 [Warning] 'user' entry 'root@hexuweb101' ignored in --skip-name-resolve mode.100616 21:05:15 [Warning] 'user' entry '@hexuweb101' ignored i

2012-03-04 11:49:06 874

原创 mysql配置文件my.ini详解

这里写的不错:http://robbin.javaeye.com/blog/461382结合硬件配置的一份已经优化好的my.cnf进行说明:# vi /etc/my.cnf以下只列出my.cnf文件中[mysqld]段落中的内容,其他段落内容对MySQL运行性能影响甚微,因而姑且忽略[mysqld]port = 3306serverid = 1socket =

2012-03-04 11:47:32 1061

原创 mysql数据导入导出

1.导出数据mysqldump 数据库名 >数据库备份名mysqldump -A -u用户名 -p密码 数据库名>数据库备份名mysqldump -d -A --add-drop-table -uroot -p > /...../xxx.sqla.导出结构不导出数据mysqldump --opt -d databases -u root -p > /...../xxx.sqlb.导出数

2012-03-04 11:45:06 341

转载 iptables指令

iptables 指令语法:iptables [-t table] command [match] [-j target/jump]-t 参数用来指定规则表,内建的规则表有三个,分别是:nat、mangle 和 filter,当未指定规则表时,则一律视为是 filter。个规则表的功能如下:nat 此规则表拥有 Prerouting 和 postrouting 两个规则链,主要功能为进

2012-03-04 11:36:10 400

原创 查看linux版本信息

1. uname -a2. cat /proc/version(redhat)3. cat /etc/issue(redhat)4. lsb_release -a

2012-03-04 11:33:08 246

转载 TOP 命令详解,各参数代表意义

top - 17:32:54 up 1 day, 18:53, 3 users, load average: 0.04, 0.07, 0.08Tasks: 121 total, 2 running, 119 sleeping, 0 stopped, 0 zombieCpu(s): 1.9%us, 0.2%sy, 0.0%ni, 97.3%id, 0.3%wa, 0.2

2012-03-03 22:14:45 1273

原创 awk之修改匹配的第N个内容

file:aaa88bbb8888ccc88dddeee[code]#修改匹配88的第一个awk '/88/&&!i++{$0="---"}1' fileawk '/88/{i++} /88/&&(i==1){$0="---"}1' file利用!i++只取第1个awk '/88/&&!a[$1]++{$0="---"}1' file#替换第三个awk '/88/

2012-03-03 21:56:00 1923

原创 awk之取每天的第一条记录和最后一条记录

file:2011-10-25 8:41:202011-10-25 8:41:382011-10-25 18:10:092011-10-26 8:29:052011-10-26 18:07:272011-10-27 8:35:412011-10-27 18:51:182011-10-28 8:38:002011-10-28 18:08:012011-10-29 8:46:13

2012-03-03 21:43:38 2582

原创 awk之生成shell数组

awk之生成shell数组ORDER="0f 30 00 22 00 04 02 04 02"[code]awk 'BEGIN{split('"\"$ORDER\""',START," ");for(i in START)print "START["i"]="START[i]}'#生成shell数组#a.使用evaleval $(awk 'BEGIN{split('"\"$ORDER\

2012-03-03 21:30:41 2512

原创 awk之split函数使用

awk之split函数使用ipstr="192.168.1.2,192.168.1.3"awk 'BEGIN{split('"\"$ipstr\""',a,",");for(i in a)print "sa["i"]="a[i]}'#直接生成shell数组eval $(awk 'BEGIN{split('"\"$ipstr\""',a,",");for(i in a)print "sa["

2012-03-03 21:28:00 6454

原创 awk之FS的指定

awk之FS的指定file:FAN1 | 11h | ok | 160.96 | 11139 RPMFAN2 | 12h | ok | 160.96 | RPMFAN3 | 13h | ok | 160.96 | 10763 RPMFAN4 | 14h | ok | 160.96 | 10998 RPMFAN5 | 15h | ok | 160.96 | 11515 RPM

2012-03-03 21:20:29 2324

原创 grep元字符扩展

3. 用于egrep和 grep -E的元字符扩展集+匹配一个或多个先前的字符。如:'[a-z]+able',匹配一个或多个小写字母后跟able的串,如loveable,enable,disable等。?匹配零个或多个先前的字符。如:'gr?p'匹配gr后跟一个或没有字符,然后是p的行。a|b|c匹配a或b或c。如:grep|sed匹配grep或sed()分组符号,

2012-03-03 20:50:49 564

原创 grep正则表达式

2. grep正则表达式元字符集(基本集)^锚定行的开始 如:'^grep'匹配所有以grep开头的行。$锚定行的结束 如:'grep$'匹配所有以grep结尾的行。.匹配一个非换行符的字符 如:'gr.p'匹配gr后接一个任意字符,然后是p。*匹配零个或多个先前字符 如:'*grep'匹配所有一个或多个空格后紧跟grep的行。 .*一起用代表任意字符。[]

2012-03-03 20:49:24 284

原创 grep选项

grep命令选项 1. -A NUM,--after-context=NUM 除了列出符合行之外,并且列出后NUM行。 gre

2012-03-03 20:34:18 561

原创 sed之4种方式指定sed的多重指令

#1.使用分号sed 's/A/B/;s/C/D/' file#2.使用-e选项sed -e 's/A/B/' -e 's/A/B/'#3.使用Bourne shell的分行指令$ sed '> s/A/B/ > s/C/D/

2012-03-03 16:44:21 818

原创 sed之:a;N;$!ba构建循环读入文件至pattern

$ cat fileaa88bb8888cc8888#替换第一个88为--sed ':a;N;$!ba;s/88/--/' filesed ':a;N;$!ba;s/88/--/1' file#替换第n个88为--sed ':a;N;$!ba;s/88/--/n' file:aN$!ba构建一个循环将整个文件逐行添加至pattern space用Next命令

2012-03-03 16:38:14 5972 1

转载 sed之h;H和:a;N;ba使用

dn: identifier=1objectClass: ZcValidRecordDsId: 2identifier:2955subOptionName: RecordSvcId: 1ZoneId: 0dn: identifier=2objectClass: ZcValidRecordDsId: 2identifier:2956subOptio

2012-02-26 16:44:22 5511

原创 awk之变量开关的使用

awk之变量开关的使用1.[Server1]ServerID=1001ServerName=ABC....[Server2]ServerID=1001ServerName=ABC....[Server3]ServerID=1001ServerName=ABC....[Server4]ServerID=1001ServerName=ABC....[要求]每个Se

2012-02-26 16:28:03 590

原创 sed之:a;N;$!ba预读入全部内容至pattern space

123232313321[要求]截取第一个2和最后一个2之间的内容:32323133即截取两个关键字之间的部分sed ':a;N;$!ba;s/[^2]*2\(.*\)2.*/\1/' file:a;N;$!ba; 到了最后一行不执行跳转,即把所有的行全读入pattern space中pattern space:123\n232\n313\n32

2012-02-26 16:20:24 4209

原创 sed之n、h、x、N、G使用

$ cat file Packages: Hello-1Owner: me me me meOther: who care?Description:Hello world!Other2: don't care[要求]1、如果Description:之后为空,将其后一行内容并入此行。2、如果Packages中包含‘Hello',将 Owner那一行copy到Des

2012-02-23 23:47:04 6803

sed调试器debug

prompt$ sedsed --help usage: sedsed OPTION [-e sedscript] [-f sedscriptfile] [inputfile] OPTIONS: -f, --file add file contents to the commands to be parsed -e, --expression add the script to the commands to be parsed -n, --quiet suppress automatic printing of pattern space --silent alias to --quiet -d, --debug debug the sed script --hide hide some debug info (options: PATT,HOLD,COMM) --color shows debug output in colors (default: ON) --nocolor no colors on debug output --dump-debug dumps to screen the debugged sed script --emu emulates GNU sed (INCOMPLETE) --emudebug emulates GNU sed debugging the sed script (INCOMPLETE) -i, --indent script beautifier, prints indented and one-command-per-line output do STDOUT --prefix indent prefix string (default: 4 spaces) -t, --tokenize script tokenizer, prints extensive command by command information -H, --htmlize converts sed script to a colorful HTML page

2012-02-23

源代码for Thinking in Java

Thinking in Java, 2nd edition, Annotated Solution Guide Revision 1.0 by Bruce Eckel ©2002 MindView, Inc.

2010-04-04

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除