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 ...
随机推荐
- 53、tensorflow基本操作
import tensorflow as tf import numpy as np x_data = np.float32(np.random.rand(2,100)) print(x_data) ...
- seleniumIDE command命令
语法组成要素:command.target.value. command命令 三大类型:(action.Accessor.assertion) 操作 存储 断言 操作类型——Action 浏览 ...
- Windows操作系统架构
用户态 用户态有四类组件,这四类组件都是以进程形式存在的,也就是说,它们都有自己的进程地址空间(其实就是一套页表). 1. System Support Processes 这些是固化的进程,也就是说 ...
- 运维 05 Shell基本命令
Shell基本命令 前言 前面咱们已经成功安装了Linux系统--centos7,那么现在跟着超哥奔向Linux的大门. Linux命令行的组成结构 [root@oldboy_python ~]# ...
- 数学&计算机工程常用希腊字母表及其发音
- UVA10118_Free Candies状态压缩
这题大概题意是,有四列糖果,一个人手中最多拿五个水果,每次拿水果只能从每一列最上面开始拿. 而如果手中的糖果相同就会成对抵消,奖励给玩家 问玩家怎样取能取到最多的糖果,并输出对数 这题是运用动态规划, ...
- Spring Boot 2.1.6 发布了!
Java技术栈 www.javastack.cn 优秀的Java技术公众号 最新消息: Spring Boot 2.1.6 昨天正式发布了,日常更新一些依赖和修复一些 BUG,没什么硬菜! 重点来了, ...
- 初探Remoting双向通信(二)
原 初探Remoting双向通信(二) 2013年06月25日 11:46:24 喜欢特别冷的冬天下着雪 阅读数 2977 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blo ...
- 《代码大全2》读书笔记 week 7
博主终于继续更<代码大全2>了 (*´・ω・`)⊃,课上老师一再强调读书笔记要写出自己的心得不能简单摘抄,所以我现在基本上只会写一下自己在阅读过程中印象深刻或者有发散思考的地方,字数可能 ...
- spring基于xml的事务控制
opm配置 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http: ...