助け合いフォーラム
トピック一覧に戻るトピック タイトル
grep・sedの正規表現について
フォーラム
最強WEB問題集LinuC/LPIC Lv1 101
投稿ユーザ(投稿日)
(2014/3/14)本文
CentOS 6.4でちょっとやってみました。
[code]
[root@host etc]# pwd
/etc
[/code]
[code]
[root@host etc]# grep -E 'igm?p' protocols
igmp 2 IGMP # internet group management protocol
igp 9 IGP # any private interior gateway (Cisco: for IGRP)
nsfnet-igp 85 NSFNET-IGP # NSFNET-IGP
[/code]
[code]
[root@host etc]# grep -E 'c+p' protocols
tcp 6 TCP # transmission control protocol
dccp 33 DCCP # Datagram Congestion Control Protocol
cpnx 72 CPNX # Computer Protocol Network Executive
cphb 73 CPHB # Computer Protocol Heart Beat
micp 95 MICP # Mobile Internetworking Control Pro.
scps 105 SCPS # SCPS
[/code]
[code]
[root@host etc]# grep -E '+tp' protocols
# See also http://www.iana.org/assignments/protocol-numbers
irtp 28 IRTP # Internet Reliable Transaction Protocol
iso-tp4 29 ISO-TP4 # ISO Transport Protocol Class 4
xtp 36 XTP # Xpress Tranfer Protocol
idpr-cmtp 38 IDPR-CMTP # IDPR Control Message Transport Proto
tp++ 39 TP++ # TP++ Transport Protocol
cftp 62 CFTP # CFTP
vmtp 81 VMTP # Versatile Message Transport
secure-vmtp 82 SECURE-VMTP # SECURE-VMTP
ttp 84 TTP # TTP
mtp 92 MTP # Multicast Transport Protocol
gmtp 100 GMTP # GMTP
l2tp 115 L2TP # Layer Two Tunneling Protocol
iatp 117 IATP # Interactive Agent Transfer Protocol
stp 118 STP # Schedule Transfer
ptp 123 PTP # Performance Transparency Protocol
crtp 126 CRTP # Combat Radio Transport Protocol
sctp 132 SCTP # Stream Control Transmission Protocol
[/code]
grepでは特にバックスラッシュは不要のようですね。
レス一覧
トピック一覧に戻る
フォーラムTopへ
Copyright (c) 2010
Ping-t All rights reserved.