50个常用的Linux命令(二)sed
[root@localhost cee]# echo this thisthisthis |sed 's/this/THIS/g'
THIS THISTHISTHIS
[root@localhost cee]# echo this thisthisthis |sed 's/this/THIS/2g'
this THISTHISTHIS
[root@localhost cee]# echo this thisthisthis |sed 's/this/THIS/3g'
this thisTHISTHIS
[root@localhost cee]# echo this thisthisthis |sed 's/this/THIS/4g'
this thisthisTHIS
[root@localhost cee]# cat temp
i love linux
i love python
william
[root@localhost cee]# sed '/^$/d' temp
i love linux
i love python
william
[root@localhost cee]# cat temp
i love linux
i love python
william
[root@localhost cee]# echo this is an example |sed 's/\w\+/[&]/g'
[this] [is] [an] [example]
[root@localhost cee]# echo this is an example |sed 's/\w\+/"&"/g'
"this" "is" "an" "example"
[root@localhost cee]# echo this is digit 7 in a number | sed 's/digit \([0-9]\)/\1/g'
this is 7 in a number
[root@localhost cee]# echo seven EIGHT |sed 's/\([a-z]\+\) \([A-Z]\+\)/\2 \1/g'
EIGHT seven
sed 'exp'|sed 'exp2' == sed 'exp;exp2'
[root@localhost cee]# text=hello
[root@localhost cee]# echo hello world | sed "s/$text/HELLO/g"
HELLO world
50个常用的Linux命令(二)sed的更多相关文章
- 50个常用的Linux命令(三)基础实例
ls ls -als -l == llls -Aldrwxrwxrwx. 2 root root 6 Dec 21 20:38 Videos-rwxrwxrwx 1 root ...
- 50个常用的Linux命令(三)awk
[root@localhost cee]# echo -e "line1\nline2"|awk '{ print }'line1line2[root@localhost cee] ...
- 50个常用的Linux命令
1.tar tar -xvf archive_name.tar 解压文件 tar -cvf archive_name.tar file 把文件file压缩成archive_name.tar tar ...
- 开发过程中常用的Linux命令
做Java开发好几年了,部署JavaWeb到服务器上,一般都选择Linux,Linux作为服务器真是不二之选,高性能,只要熟悉Linux,操作快捷,效率很高. 总结一下工作中常用的Linux命令备忘: ...
- 初学者常用的LINUX命令
测试初学者常用的LINUX命令 一.常用管理命令:1. shutdown -h now 关机命令2. shutdown -r now (reboot) 立即重启命令 3. clear 清屏命令 4. ...
- 每天一个linux命令(61):vi命令 /企业常用的linux命令清单
vi/vim 的使用 基本上 vi/vim 共分为三种模式,分别是一般模式.编辑模式与指令列命令模式. 这三种模式的作用分别是: 一般模式:以 vi 打开一个档案就直接进入一般模式了(这是默认的模式) ...
- 工作中常用的Linux命令:mkdir命令
本文链接:http://www.cnblogs.com/MartinChentf/p/6076075.html (转载请注明出处) 在Linux系统中,mkdir命令用来创建一个目录或一个级联目录. ...
- 工作中常用的Linux命令:crontab命令
本文链接:http://www.cnblogs.com/MartinChentf/p/6060252.html (转载请注明出处) crontab是一个用来设置.删除或显示供守护进程cron执行的定时 ...
- 工作中常用的Linux命令:ipcs/ipcrm命令
本文链接:http://www.cnblogs.com/MartinChentf/p/6057100.html (转载请注明出处) ipcs 1. 命令格式 ipcs [resource-option ...
随机推荐
- 快速搭建Vue项目
快速搭建Vue项目 第一次安装vue项目Vue推荐开发环境Node.js 6.2.0.npm 3.8.9.webpack 1.13.vue-cli 2.5.1.webstrom2016 安装环境: 安 ...
- Dart编程语言入门
Dart基础入门语法介绍,详细说明可以查看相关视频<Dart编程语言入门>. 变量与常量 变量 1.使用 var 声明变量,默认值为 null var a;//null a = 10; 2 ...
- MySQL5.7 Dockerfile
#Dockerfile for mysql5.7 FROM centos COPY ["src","/src"] RUN groupadd -g 1003 my ...
- Linux 磁盘分区管理
Linux 磁盘管理进阶 磁盘分区介绍 基本分区(primary partion) 基本分区也称主分区,引导分区.每块磁盘分区主分区与扩展分区加起来不能大于四个. 基本分区创建后可以立即使用,但是有分 ...
- Shell 文本处理命令
命令:cut –d’:’ -f1, 文件名 #切割处文件列的参数. -d切割字符. -f列的第几个参数. -c1-10指定字符串范围行的第一个到第十个. 命令:sort 文件名 #根据第一列第一个字符 ...
- IP白名单的实现(PHP)
有些项目可能会用到一个IP地址的白名单黑名单之类的验证. 比如,只有IP地址在白名单中,才可以访问该系统. 那么此时,白名单的维护,一般是一个文件,里边是一些IP地址(每行一个IP),当然也有的可能是 ...
- 学习了一天的python,终于可以爬爬了-_-
恒久恒久以前在语言大陆就听过一种叫,人生苦短,我用python的至理名言.陆陆续续在课下和业余生活中学习的一点python,知道基本的语法和规则,不过py的库实在是太多了,而且许多概念也没有深入的学习 ...
- freeswitch 显示主叫名称和主叫号码
1.指定主叫号码 origination_caller_id_number 参数来指定显示的主叫号码 2.指定主叫名称 origination_caller_id_name 参数来指定显示的主叫名称 ...
- flutter登录页部分内容
import 'package:flutter/material.dart'; class MyIdPage extends StatelessWidget { @override Widget bu ...
- TCP协议三次握手、四次挥手
TCP的概述 TCP 把连接作为最基本的对象,每一条 TCP 连接都有两个端点,这种断点我们叫作套接字(socket),它的定义为端口号拼接到 IP 地址即构成了套接字,例如,若 IP 地址为 192 ...