小编ell*_*san的帖子

使用grep获取仅12个字母的字母行

使用grep

testing.txt中有12个字母-仅字母行?

testing.txt的摘录

tyler1
Tanktop_Paedo
xyz2@geocities.com
milt@uole.com
justincrump
cranges10
namer@uole.com
soulfunkbrotha
timetolearnz
hotbooby@geocities.com
Fire_Crazy
helloworldad
dingbat@geocities.com
Run Code Online (Sandbox Code Playgroud)

从这个摘录中,我想得到2的结果。(helloworldad和timetolearnz)

我想检查每一行,仅grep每行中包含12个字符的行。我想不出办法用grep做到这一点。

仅对于字母,我想我可以使用

grep [A-Za-z] testing.txt
Run Code Online (Sandbox Code Playgroud)

但是,如何使这12个字符仅显示[A-Za-z]字符?

unix linux grep

2
推荐指数
1
解决办法
3377
查看次数

标签 统计

grep ×1

linux ×1

unix ×1