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. ES6笔记

    /** * Created by Administrator on 2017/4/13. */ /*---------------------Es6编码规范---------------------* ...

  2. java常见错误总结

    1. 现象:将数组转为List后进行removeAll()操作,报java.lang.UnsupportedOperationException错误. 代码: /** * 获取标记ID * @retu ...

  3. Decimal integer conversion

    问题 : Decimal integer conversion 时间限制: 1 Sec  内存限制: 128 MB 题目描述 XiaoMing likes mathematics, and he is ...

  4. 10进制 VS 2进制

    10进制 VS 2进制 时间限制: 1 Sec  内存限制: 32 MB 题目描述 样例输出 623 #include<stdio.h> #include<string.h> ...

  5. excel生成数据

    Sub function1()Dim i As LongFor i = 1 To 1000000Cells(i, 1) = "A" & iCells(i, 2) = &qu ...

  6. 创建WIFI热点

    @echo off:beginecho 笔记本做无线WiFi程序(首次使用请先设置WiFi帐户.)echo 1.设置WiFi帐户,请按1echo 2.开启WiFi功能,请按2echo 3.闭关WiFi ...

  7. python字典操作用法总结

    基本语法: dict = {'ob1':'computer', 'ob2':'mouse', 'ob3':'printer'} 技巧: 字典中包含列表:dict={'yangrong':['23',' ...

  8. C# 不使用递归遍历目录树中的文件和文件夹

    public class StackBasedIteration { static void Main(string[] args) { // Specify the starting folder ...

  9. 饮冰三年-人工智能-linux-03 Linux文件管理(权限管理+归档+压缩)

    1:对文件的权限管理 drwxr-xr-x. 最后一个.表示在安全情况下创建的.selinux a: d表示目录:-表示普通文件:l表示快捷方式:b设备文件 b:- 属主的权限 r:读权限:w:写权限 ...

  10. POJ 1064 Cable master (二分法+精度控制)

    Cable master Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 65358   Accepted: 13453 De ...