用grep提取正則匹配上的字符串
echo "a192.67.20.1abc192.168.20.1a" | grep --color=auto -P '(\d{1,3}.){3}\d{1,3}' -o
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
bash中使用隨機數
產生正數公式: rnumber=$(((RANDOM%(max-min+divisibleBy))/divisibleBy*divisibleBy+
辉hoi
2020-07-07 14:42:35
bash參數使用技巧
$0 = shell名稱或shell腳本名稱 $1 = 第一個shell參數 ... $9 = 第九個shell參數 $# = 位置參數的個數 "$
辉hoi
2020-07-07 14:42:35
bash中的if點滴
辉hoi
2020-02-23 03:29:36
awk 內置變量的使用
辉hoi
2020-02-23 03:29:36
bash 尋找包含特定關鍵字的文件
辉hoi
2020-02-23 03:29:36
bash中的信號捕獲
辉hoi
2020-02-23 03:29:36
bash中使用隨機數
產生正數公式: rnumber=$(((RANDOM%(max-min+divisibleBy))/divisibleBy*divisibleBy+
辉hoi
2020-07-07 14:42:35
bash參數使用技巧
$0 = shell名稱或shell腳本名稱 $1 = 第一個shell參數 ... $9 = 第九個shell參數 $# = 位置參數的個數 "$
辉hoi
2020-07-07 14:42:35
bash中的if點滴
辉hoi
2020-02-23 03:29:36
awk 內置變量的使用
辉hoi
2020-02-23 03:29:36
bash 尋找包含特定關鍵字的文件
辉hoi
2020-02-23 03:29:36
bash中的信號捕獲
辉hoi
2020-02-23 03:29:36
刪除匹配關鍵字的行和後幾行
辉hoi
2018-08-23 16:14:12