论坛风格切换切换到宽版
  • 1055阅读
  • 5回复

[问题求助][RedHat] 请教——按书上写grep -n [^0-9] regular.txt的问题 [复制链接]

上一主题 下一主题
离线517265.
 
发帖
2147
C币
-505086
威望
377
贡献值
3
银元
-1
铜钱
4734
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-01
学习grep命令     grep -n [^0-9] regular.txt   . 我输出的结果是全部. 按语法不是应该排除掉带数字的行么  比如3183那.行.

re.gular.txt 的内容 .
"Open Sou.rce" is. a good mechanism to develop programs.域名
ap.ple is my favo.rite food..
Football .game is not use feet o.nly.           建材
this dres.s. doesn't fit me.域名
However, this dres..s is about $ 3183 dollars.    健康
GNU is .free air not fre.e beer.    美容
Her hair is very beau.ty.外贸
I c.an't finish the test.    健康
Oh! The soup taste g.ood.    外汇
mo.torcycle is .cheap than car..
This win.dow is clear.--- 印刷
the sym.bol. '*' is represented as start..
Oh!        My go.d!              乙肝
The gd softw.are is a library for drafting. programs..
You are the bes.t is mean you are the no.. 1.    健康
The world <Happy> is the sam.e with "g.lad".电影
I like dog.
google is the. best tool.s for search keyword.    健康
goooooog.le yes!.
go! go! Let's g.o.    健康
# I am VBird



我的操作
[root@Kung.fu new folder]# grep -n [^0-9]. regular_express.txt .
1:"Open Source" is a .good mechanism to develo.p programs.服务器
2:apple. is my .favorite food..
3:Football .game is not use feet o.nly..
4:this dress. does.n't fit me.[成人用品]
5.:Howev.er, this dress is about $ 3183 dollars.             电子
6:G.NU is free a.ir not free beer..
7:Her .hair is .very beauty.           建材
8:I can't finish. th.e test..
9:Oh! .The soup tast.e good.服务器
10.:motorcycle is c.heap than car.投资
11:This window is .clear.电脑
12:th.e symbol '*' .is represented as start.--------------彩票
1.3:Oh!  My god!           女人
14:The gd software is a library for drafting progra.m.s.--------------彩票
15:You are the best is mean. you a.re the no. 1.虚拟主机
16:The world <Happ.y> is th.e same with "glad".[成人用品]
17:I like dog.
1.8:google is the best .tools for search keyword.学习
19:.goooooogle yes!.
20:.go! go! Let's go.投资
21:# I am VBir.d    健康

[ 本帖最后由 dee.pbreathingin 于. 2009-3-9 21:37 编辑 ]           鲜花

评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
离线ygzhd.
发帖
1968
C币
-236010
威望
330
贡献值
6
银元
0
铜钱
4280
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-14
Re:[RedHat]
grep -v '[0-9]' urfile

离线dyy0214.
发帖
2060
C币
-60444
威望
372
贡献值
1
银元
0
铜钱
4565
人人网人气币
0
只看该作者 板凳  发表于: 2010-04-14
Re:[RedHat]
感谢高手! 但是我的写的grep语句逻辑上哪有错,为什么会全部输出呢?





QUOTE:原帖由 leetaedong 于 2009-3-9 21:40 发表
grep -v '[0-9]' urfile


离线flyworld.
发帖
1996
C币
-198913
威望
351
贡献值
1
银元
-1
铜钱
4402
人人网人气币
0
只看该作者 地板  发表于: 2010-04-14
Re:[RedHat]


QUOTE:原帖由 deepbreathingin 于 2009-3-9 21:43 发表
感谢高手! 但是我的写的grep语句逻辑上哪有错,为什么会全部输出呢?





那不是你要的意思...  ^ 跟 - 好像也不能混一起..

发帖
2053
C币
-60690
威望
400
贡献值
1
银元
0
铜钱
4618
人人网人气币
0
只看该作者 4楼 发表于: 2010-04-14
Re:[RedHat]
非常感谢你!!  学习到了


QUOTE:原帖由 leetaedong 于 2009-3-9 21:47 发表

那不是你要的意思...  ^ 跟 - 好像也不能混一起..


离线eddyc.
发帖
2168
C币
-60282
威望
393
贡献值
1
银元
-1
铜钱
4729
人人网人气币
0
只看该作者 5楼 发表于: 2010-04-14
Re:[RedHat]
grep -n [0-9] regular.txt
快速回复
限100 字节
批量上传需要先选择文件,再选择上传
 
上一个 下一个