[英]How to match two different length and different column text file with header using join command in linux
[英]How to count exact match of certain patterns in a text file using linux shell command?
我想使用linux shell命令在一個包含很多混合模式的文本文件中找到某些模式的計數。
我有一個包含以下模式的文本文件,
[--------------]
[+--------------+]
[+----------+------------+--------------------+]
[+---------------------+---------------------+]
如何找到僅第一個模式[--------------]
確切計數?
注意:請勿包括方括號作為樣式。 方括號內只有特殊字符是圖案。
貓./file | sed -e's / \\] / \\] \\ n /'| grep“ \\ [-------------- \\]” -c
貓讀文件
sed用] \\ n替換]
grep在每一行中搜索您的表達式並顯示行數-c
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.