If you want to delete lines 5 through 10 and 12:

sed -e '5,10d;12d' file

This will print the results to the screen. If you want to save the results to the same file:

sed -i.bak -e '5,10d;12d' file

This will back the file up to file.bak, and delete the given lines.

shell delete with line number的更多相关文章

  1. Eclipse "Unable to install breakpoint due to missing line number attributes..."

    Eclipse 无法找到 该 断点,原因是编译时,字节码改变了,导致eclipse无法读取对应的行了 1.ANT编译的class Eclipse不认,因为eclipse也会编译class.怎么让它们统 ...

  2. 无法debug断点跟踪JDK源代码——missing line number attributes的解决方法

    在项目工程->Properties->Java Build Path->Libraries中导入的JRE System Library库里,给jar包添加JDK源代码包后,能够直接打 ...

  3. IDEA Show Line Number

    刚开始用IDEA,经常发现右侧没有显示行号,然后去右键选一下,就显现了 一直没有留意这个现象,刚用vim想删几行数据代码,突然发现没有行号了 明明记得刚刚才右键显示了的 好吧,有行号用着比较顺心了.. ...

  4. Eclipse-debug时提示absent line number information的解决办法

    unable to install breakpoint in ...(file name) due to miss line number attributes. midify compliter ...

  5. Unable to perform unmarshalling at line number 16 and column 63 in RESOURCE hibernate.cfg.xml. Message: cvc-elt.1: 找不到元素 'hibernate-configuration' 的声明。

    七月 02, 2017 4:32:37 下午 org.hibernate.Version logVersionINFO: HHH000412: Hibernate Core {5.2.10.Final ...

  6. 如何在Windows下开发Python:在cmd下运行Python脚本+如何使用Python Shell(command line模式和GUI模式)+如何使用Python IDE

    http://www.crifan.com/how_to_do_python_development_under_windows_environment/ 本文目的 希望对于,如何在Windows下, ...

  7. MyEclipse 断点打不上 提示 absent line number information

    在加入断点时,提示出 unable to install breakpoint in ...(file name) due to miss line number attributes. midify ...

  8. [shell] while read line 与for循环的区别

    [shell] while read line 与for循环的区别 while read line 与for循环的区别---转载整理 while read line 是一次性将文件信息读入并赋值给变量 ...

  9. xcode Delete current line

    Delete a line like eclipse CTRL+D (tested on Xcode 4.5.1) : First of all, change these rights : sudo ...

随机推荐

  1. 【JS】中的原型prototype到底是个啥

    一.什么是原型 原型prototype是函数的一个属性,这个属性是一个指针,指向一个对象(原型对象),这个原型对象的用途是包含可以由特定类型的所有实例共享的属性和方法. 函数也是一种对象.它也是属性的 ...

  2. Spark启动时的master参数以及Spark的部署方式

    我们在初始化SparkConf时,或者提交Spark任务时,都会有master参数需要设置,如下: conf = SparkConf().setAppName(appName).setMaster(m ...

  3. day10 函数

    函数基础 函数概念 为什么用函数 什么是函数 定义函数 调用函数 返回值详解上节回顾 文件处理 修改文件 1.读取要修改文件内容 read可能导致内存溢出 赋值给变量 修改 将修改后的内容重新写入文件 ...

  4. linux符号与正则表达式

    特殊符号    >    或者1>   标准输出重定向 先把文件的内容清空  再放入新的内容 >> 或   2>>  追加重定向  把内容放入文件的最后一行 1   ...

  5. Metasploit渗透测试模块(一)

    1.Metasploit模块加载 初始化界面,成功要加载数据库 查看 Metasploit中已近存在的漏洞模块使用 show payloads

  6. shiro配合html页面完成细粒化权限控制

    shiro配合html页面完成细粒化权限控制 原创 2016年10月04日 12:02:34 标签: shiro / 框架 / 界面 / 权限 8924 shiro是现在非常普遍使用的java权限框架 ...

  7. C# 读取sqlite文件

    class Program { static void Main(string[] args) { getsqliteData(); } public static void getsqliteDat ...

  8. 007-Python函数-装饰器

    函数回顾 1.函数可以当做一个参数赋值给另一个函数: def func(): print("in the func") def foo(x): x() foo(func) 输出: ...

  9. php归档格式:phar文件详解(创建、使用、解包还原提取)

    转载一篇,突然遇到一个冷知识,phar的东东,貌似和jar.war是一种鬼. 重点使用一下下面这个东东,就能解包出来东东了. $phar = new Phar('lib/yunke.phar', 0) ...

  10. Windows10右键添加“在此处打开命令窗口”

    cmdHere.reg: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHere] @= ...