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 ...
随机推荐
- 爬虫 fake_useragent
import requests from fake_useragent import UserAgent ua = UserAgent() headers = { "UserAgent&qu ...
- 07、python的基础-->数据类型、集合、深浅copy
一.数据类型 1.列表 lis = [11, 22, 33, 44, 55] for i in range(len(lis)): print(i) # i = 0 i = 1 i = 2 del li ...
- Neo4J空间数据存储
1.Neo4j Spatial 简介 1.1Neo4j Spatial概念 Neo4j Spatial项目是图数据库Neo4j的一个插件,它通过将空间数据映射到图模型(graph model),它将对 ...
- SQL中的DDL、DML、DCL、TCL
1.DDL(Data Definition Language)数据库定义语言statements are used to define the database structure or schema ...
- linux 之文件重命名
没有专门的重命名 命令 用 mv a b 就可以重命名了 mv :move 移动文件(延伸功能:重命名,linux系统没有专门的重命名命令) 基本格式: 移动文件:mv 文件名 移动目的地文件名 重命 ...
- ionic3 emoj表情包插件 emoji-picker
1.效果演示: 2.安装扩展包依赖 npm i @ionic-tools/emoji-picker --save 3.app.module.ts中导入插件 import { EmojiPickerMo ...
- list采坑记录一下
List<Integer> cards = Lists.newArrayList(6,10,11,12,21,23,29,30,38,39,42,43,46,51,53,59,60);Li ...
- KiCAD泪滴
KiCAD泪滴 KiCAD没有自带的补泪滴功能,必须先下载一个插件,然后才能进行泪滴操作 链接 提取码:ey8o 1.下载泪滴插件,解压后将整个文件夹复制到目录 C:\Program Files\K ...
- 【Leetcode周赛】从contest1开始。(一般是10个contest写一篇文章)
注意,以前的比赛我是自己开了 virtual contest.这个阶段的目标是加快手速,思考问题的能力和 bug-free 的能力. 前面已经有了100个contest.计划是每周做三个到五个cont ...
- 【LeetCode】排序
[349] Intersection of Two Arrays [Easy] 两个无序可重复数组找交集, 交集要求元素唯一. Given nums1 = [1, 2, 2, 1], nums2 = ...