shell命令
来源:互联网 发布:mac 10.12.6系统怎么样 编辑:程序博客网 时间:2024/06/07 10:23
shell命令之sed命令 我感觉sed最有用的命令是修改字符串的命令;
比如 this is first;
执行sed "s/is/IS/" 1.txt;
这时就变成了thIS IS first;这里会把is改成IS
还有这个命令:
this is first
this is second
this is three
这里使用命令sed "1 c/ 中国" 1.txt现在就变成了;
中国
this is second
this is three
还有这个命令:
this is first
this is second
this is three
这命令里使用sed "2 a/ 中国" 1.txt现在就变成了:
this is first
this is second
中国
this is three
还有这个命令:
this is first
this is second
this is three
这里使用sed "2 i/中国" 1.txt现在就变成了:
this is first
中国
this is second
this is three
grep 命令
grep "[a-z][a-z][a-z]L" 1.txt
grep是字符串匹配命令
这里匹配的是第一个字母是a-z中的随意一个字母第二个字母是a-z中的随意中的一个第三个字母同样的道理
以L位结尾这里一共可以匹配的是26*26*26中情况;
grep "正则表达式" 1.txt
正则表达式 regular expression
grep "p$" 1.txt匹配出以p为结尾的字母;
0 0
- shell命令
- shell命令
- shell命令
- Shell命令
- shell命令:
- Shell命令
- shell命令
- shell命令
- shell命令
- shell 命令
- shell 命令
- shell命令
- shell 命令
- SHELL命令
- shell命令
- shell 命令
- Shell 命令
- Shell 命令
- 一个带有属性的字符串(比如文字颜色/字体属性等文字属性) 在label上显示需要使用 attributedText 属性
- <LeetCode><Easy> 38 Count and Say
- hibernate与mybatis比较
- Opencv+Kinect2.0获取BodyIndex图像
- InetAddress类的常用方法介绍
- shell命令
- GPU编程
- 严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderLis
- Codevs P1653 种树 2
- 圆排列问题
- mac android eclipse + adt + sdk
- 80x86处理器的标志寄存器
- 编辑距离问题
- 剑指offer.14:调整数组顺序使奇数位于偶数前面