sed delete
sed -i '1d' a.txt删首行
sed -i '$d' b.txt删尾行
sed -i 's/[ ]//g' c.txt删空格
sed -i '/^$/d' d.txt删空行
sed -i ‘/^[0-9]$/d' a.txt删包含数字的行
sed -i ‘1,2d’a.txt删2行
sed -i ‘/love/d’ a.txt删包含string的行
sed delete的更多相关文章
- sed 替换换行回车
A carriage return linefeed (CRLF) is a special sequence of characters, used by DOS/Windows, to signi ...
- [转帖]Introduction to text manipulation on UNIX-based systems
Introduction to text manipulation on UNIX-based systems https://www.ibm.com/developerworks/aix/libra ...
- linux sed 替换(整行替换,部分替换)、删除delete、新增add、选取
sed命令行格式为: sed [-nefri] ‘command’ 输入文本 常用选项: -n∶使用安静(silent)模式.在一般 sed 的用法中,所有来自 STDI ...
- sed awk 样例
sed [options] '[action]' filename options: -n:一般sed命令会把所有数据都输出到屏幕,如果加入此选项,则只会把经过sed命令处理的行输出到屏幕. -e:允 ...
- Linux echo, sort, sed 等一些命令总结
linux echo, sort, sed是初学linux shell script 的一些常用的命令.基本上来说,如果能够掌握了这些命令,我们就能写出一些不错的linux脚本.以下是我遇到的以下常用 ...
- linux学习基础6之sed用法详解
1 sed 又称为流编辑器,它逐行将文本文件中的行读取到模式空间中间去,将符合编辑条件的行进行编辑后输出到显示器上来.默认sed不编辑原文件只处理模式空间中的内容. 2 sed用法 sed [opti ...
- sed详细分析
[一.简单描述] sed命令类似命令行的文本编辑器,以行为单位(见注1).除非带命令i(in-place)否则源文件内容并不会被更新. [二.使用] [2.1.使用方式] 存在两种使用方式: 1. ...
- Linux sed Examples--转载
原文地址:https://www.systemcodegeeks.com/shell-scripting/bash/linux-sed-examples/?ref=dzone Sed is basic ...
- grep, sed, awk
这几个工具是shell中非常好用的文本流处理工具,可以进行查找,编辑或者分析等工作,它们都支持正则表达式,也支持使用shell内置的变量 grep grep是一个字符串比较工具,用于从文件中提取满足条 ...
随机推荐
- oracle 删除用户及相关表数据,释放磁盘空间
来源于:http://www.itpub.net/thread-513609-1-1.html http://bbs.csdn.net/topics/330251089 http://blog.csd ...
- PHP ElasticSearch的使用
系统是Windows server 2003. ElasticSearch是一个基于Lucene的稳定的.分布式.RESTFul的搜索引擎.其实所谓的RestFul就是它提供URL供你调用(建立索引和 ...
- 通过javascript在网页端生成zip压缩包并下载
zip.js是什么 zip.js的github项目地址:http://gildas-lormeau.github.io/zip.js/ 通过zip.js封装一个能在网页端生成zip文件的插件, 直接在 ...
- 去掉iPhone、iPad的默认按钮样式 去掉高光样式:
input[type="button"], input[type="submit"], input[type="reset"] { -web ...
- jquery-遍历each
使用案例一 $.ajax({ url : webPath + "/clickCount", type : "POST", dataType : "js ...
- Echarts-画堆积柱状图
导入echarts包 <script src='../scripts/libraries/echarts/echarts-all.js'></script> 堆积图js $(f ...
- 【HDU 4445】Crazy Tank(暴力)
高中物理斜抛运动,简单分析一下角度固定下来则可以计算每个cannonball的降落坐标lnd. 因此暴力计算不同角度下的结果. #include <cstdio> #include &qu ...
- threading示例
多线程举例: import time import threading def worker(): print ("hello.Kamil") time.sleep(1)#等待一秒 ...
- Hive 中的分号问题
1. hive表中有一列值,是以 分号 ; 为分隔符连接存储的 1470047164;1470047628;1470049068;1470048978;1470048922;1470047658;1 ...
- Leetcode 437. Path Sum III
You are given a binary tree in which each node contains an integer value. Find the number of paths t ...