File content:

<a href="ceph-0.80.9-82.1.x86_64.rpm"><img src="/icons/rpm.gif" alt="[   ]" width="16" height="16" /></a> <a href="ceph-0.80.9-82.1.x86_64.rpm">ceph-0.80.9-82.1.x86_64.rpm</a>                                     11-Jun-2015 16:37  9.9M   <a href="ceph-0.80.9-82.1.x86_64.rpm.mirrorlist">Details</a>
<a href="ceph-common-0.80.9-82.1.x86_64.rpm"><img src="/icons/rpm.gif" alt="[   ]" width="16" height="16" /></a> <a href="ceph-common-0.80.9-82.1.x86_64.rpm">ceph-common-0.80.9-82.1.x86_64.rpm</a>                              11-Jun-2015 16:37  3.9M   <a href="ceph-common-0.80.9-82.1.x86_64.rpm.mirrorlist">Details</a>
<a href="ceph-common-debuginfo-0.80.9-82.1.x86_64.rpm"><img src="/icons/rpm.gif" alt="[   ]" width="16" height="16" /></a> <a href="ceph-common-debuginfo-0.80.9-82.1.x86_64.rpm">ceph-common-debuginfo-0.80.9-82.1.x86_64.rpm</a>                    11-Jun-2015 16:37   49M   <a href="ceph-common-debuginfo-0.80.9-82.1.x86_64.rpm.mirrorlist">Details</a>

......

Command:

grep -P -o ">\K[^ ]+?x86_64.rpm" <file name>

-P : perl format regular expression

-o : only matched content

\K : throw away content of before \K

Result:

xen-doc-html-4.4.2_06-3.1.x86_64.rpm
xen-kmp-default-4.4.2_06_k3.12.28_4-3.1.x86_64.rpm
xen-kmp-default-debuginfo-4.4.2_06_k3.12.28_4-3.1.x86_64.rpm
xen-libs-4.4.2_06-3.1.x86_64.rpm
xen-libs-debuginfo-4.4.2_06-3.1.x86_64.rpm
xen-tools-4.4.2_06-3.1.x86_64.rpm
xen-tools-debuginfo-4.4.2_06-3.1.x86_64.rpm
xen-tools-domU-4.4.2_06-3.1.x86_64.rpm

How to only capute sub-matched character by grep的更多相关文章

  1. strtok strchr strrchr strchrnul

    NAME       strchr, strrchr, strchrnul - locate character in string SYNOPSIS       #include <strin ...

  2. 常用算法3 - 字符串查找/模式匹配算法(BF & KMP算法)

    相信我们都有在linux下查找文本内容的经历,比如当我们使用vim查找文本文件中的某个字或者某段话时,Linux很快做出反应并给出相应结果,特别方便快捷! 那么,我们有木有想过linux是如何在浩如烟 ...

  3. 归纳整理Linux下C语言常用的库函数----内存及字符串控制及操作

    在没有IDE的时候,记住一些常用的库函数的函数名.参数.基本用法及注意事项是很有必要的. 参照Linux_C_HS.chm的目录,我大致将常用的函数分为一下几类: 1. 内存及字符串控制及操作 2. ...

  4. js css 实现简单的计算器

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  5. CharUtil

    package com.opslab.util; import java.io.UnsupportedEncodingException; /** * Various character and ch ...

  6. man bash

    BASH(1) General Commands Manual BASH(1) NAME bash - GNU Bourne-Again SHell SYNOPSIS bash [options] [ ...

  7. R语言函数化学习笔记6

    R语言函数化学习笔记 1.apply函数 可以让list或者vector的元素依次执行一遍调用的函数,输出的结果是list格式 2.sapply函数 原理和list一样,但是输出的结果是一个向量的形式 ...

  8. Dive into re Module in Python

    Dive into RE in Python Standard re module in python is powerful to handle text manipulation,such as ...

  9. bash5.0参考手册

    Bash Reference Manual a.summary-letter { text-decoration: none } blockquote.indentedblock { margin-r ...

随机推荐

  1. 当你在浏览器地址栏输入一个URL后回车,将会发生的事情?

    原文:http://igoro.com/archive/what-really-happens-when-you-navigate-to-a-url/ 作为一个软件开发者,你一定会对网络应用如何工作有 ...

  2. 在yii框架中如何连接数据库mongodb

    在文件夹common/config/main_local.php中加入如下代码: <?php return [ 'components' => [ 'mongodb' => [ 'c ...

  3. 配置nodejs环境

    一.由于node有多种版本号,每个版本号的API肯定也有些细微的差别,在工作中有可能要经常切换node的版本号,因此可以下载nvm使其来管理node的版本号. 首先下载nvm,官网:https://g ...

  4. ORACLE常用SQL(session&badSql)

    查看session:select sess.sid, sess.serial#, lo.oracle_username, lo.os_user_name, ao.object_name, lo.loc ...

  5. 对DIP IoC DI的理解与运用

    DIP,IoC,DI基本概念 依赖倒置原则(DIP,Dependency Inverse Principle):强调系统的“高层组件”不应当依赖于“底层组件”,并且不论是“高层组件”还是“底层组件”都 ...

  6. Win10 UWP vs add github

    vs github 插件 教程 官方教程 点击查看存储库,跳转到 DemoHttp for github

  7. C语言头文件组织与包含原则

    转自:http://www.cnblogs.com/clover-toeic/p/3728026.html 说明 本文假定读者已具备基本的C编译知识. 如非特殊说明,文中“源文件”指*.c文件,“头文 ...

  8. android中设置控件获得焦点 (转)

    android中,要使控件获得焦点,需要先setFocus,再requestFocus. 以Button为例:                 btn.setFocusable(true);      ...

  9. pat甲级题解(更新到1013)

    1001. A+B Format (20) 注意负数,没别的了. 用scanf来补 前导0 和 前导的空格 很方便. #include <iostream> #include <cs ...

  10. 封锁Skype的广告(非原创)

    这个我也忘记在哪看的了 记录一下 好早以前微软收购了Skype 然后Skype就出现广告了.... 好吧废话少说  打开 控制面板 -> 网络和Internet -> Internet选项 ...