sed use case: Filter without editing
if we want to filter with sed pattern and just print the filtered lines without any further editing , we can do it like this
ls -a1 ~ | sed -ne "/^\./p"
This command will print all dir entries that starts with "."
ls -a1 ~ | sed -ne "/^\./p" | sed -ne "/bash/p"
I want to find meta files related to bash, so I got the result:
.bash_history
.bash_logout
.bashrc
we can view each file content by
ls -a1 ~ | sed -ne "/^\./p" | sed -ne "/bash/p" | xargs -n less
delete file and directories except "term.sh" and "test.cpp"
ls | sed -e "/^term.sh$/d" | sed -e "/^test.cpp$/d" | xargs -n rm -rf
show contents of all status file in current directory tree
find . -iname status | xargs -n less
sed use case: Filter without editing的更多相关文章
- Linux sed Examples--转载
原文地址:https://www.systemcodegeeks.com/shell-scripting/bash/linux-sed-examples/?ref=dzone Sed is basic ...
- Solr 6.7学习笔记(02)-- 配置文件 managed-schema (schema.xml) - filter(5)
自定义fieldType时,通常还会用到filter.filter必须跟在tokenizer或其它filter之后.如: <fieldType> <analyzer> < ...
- 【solr filter 介绍--转】http://blog.csdn.net/jiangchao858/article/details/54989025
Solr的Analyzer分析器.Tokenizer分词器.Filter过滤器的区别/联系 Analyzer负责把文本字段转成token stream,然后自己处理.或调用Tokenzier和Filt ...
- Linux就这个范儿 第10章 生死与共的兄弟
Linux就这个范儿 第10章 生死与共的兄弟 就说Linux系统的开机.必须经过加载BIOS.读取MBR.Boot Loader.加载内核.启动init进程并确定运行等级.执行初始化脚本.启动内核模 ...
- 在suse上折腾iptables
需求背景:有台服务器希望屏蔽掉某IP对它的SSH连接. 临时客串下DevOps,下面的做法可能在专业运维的同学里不太专业,还请指教. 该服务器的操作系统是SuSE Linux,服务器上是安装了ipta ...
- Linux 下Shell的学习3-优秀demo
优秀的DEMO cat /etc/init.d/functions -->里面有颜色定义cat /etc/rc.d/rc.sysinit cat /etc/init.d/nfscat /et ...
- .NET深入实战系列--EF到底怎么写过滤条件
本文唯一访问地址:http://www.cnblogs.com/yubaolee/p/DynamicLinq.html 对于系统开发来说,按不同字段进行过滤查询是一种常见的需求.在EF中通常的做法是: ...
- .NET 开源SqlServer ORM框架 SqlSugar 3.0 API
3.1.x ,将作为3.X系统的最后一个版本,下面将会开发 全新的功能 更新列表:https://github.com/sunkaixuan/SqlSugar/releases 优点: SqlSuga ...
- clientTarget与用户代理别名
将特定用户代理的别名添加到用户代理别名的内部集合中. 来自 <https://msdn.microsoft.com/zh-cn/library/6379d90d(v=vs.110).aspx&g ...
随机推荐
- 如何查看red gate安装时的log
安装界面,点击左上角的log open log file C:\Users\clu\AppData\Local\Temp\{69EEB6B0-A9AD-4BD4-8231-92C992F1FF05}\ ...
- 77、tensorflow手写识别基础版本
''' Created on 2017年4月20日 @author: weizhen ''' #手写识别 from tensorflow.examples.tutorials.mnist import ...
- SPSS输出的结果都要写到文章中吗
SPSS输出的结果都要写到文章中吗 经常有人问到,SPSS输出的结果都要写到文章中吗?文章中应该写什么呢?比如,均值.中位数.众数.标准差.百分位数.最小值.最大值等等,都要出现在文章中吗?洋洋洒洒那 ...
- activiti7查询历史数据
package com.zcc.activiti02; import org.activiti.engine.HistoryService;import org.activiti.engine.Pro ...
- Tomcat启动脚本(3)setclasspath.bat
@echo off rem Licensed to the Apache Software Foundation (ASF) under one or more rem contributor lic ...
- 一条简单的 SQL 执行超过1000ms,纳尼?
作者:VipAugus https://juejin.im/post/5ce906a3e51d455a2f2201dc MySQL对我说"Too young, too naive!" ...
- emacs-w3m查看html帮助手册
emacs-w3m查看html帮助手册 */--> code {color: #FF0000} pre.src {background-color: #002b36; color: #83949 ...
- android中的ContentProvider实现数据共享
为了在应用程序之间交换数据,android中提供了ContentProvider,ContentProvider是不同应用程序之间进行数据交换的标准API.当一个应用程序需要把自己的数据暴露给其他程序 ...
- Puppeteer自动化测试cnode.js中文社区
如果完全不了解puppeteer的朋友可以去看看我的这篇随笔:https://www.cnblogs.com/zlforever-young/p/11569890.html 开始之前需要了解的知识:E ...
- JavaScript翻转字符串方法
先把字符串转化成数组String.prototype.split(),再借助数组的reverse方法翻转数组顺序(Array.prototype.reverse()),然后把数组转化成字符串. 使用的 ...