linux命令
来源:互联网 发布:计算机编程大学专业 编辑:程序博客网 时间:2024/06/06 01:48
echo命令
echo命令的功能是在显示器上显示一段文字,一般起到一个提示的作用。 该命令的一般格式为: echo [ -n ] 字符串 其中选项n表示输出文字后不换行;
sed的语法为:
sed [options] '{command}' [filename]
替换:
sed 's/{old value}/{new value}/'
$ echo The tiger cubs will meet on Tuesday after school | sed
's/tiger/wolf/'
The wolf cubs will meet on Tuesday after school
$
如果是多个:
$ echo The tiger cubs will meet on Tuesday after school | sed -e '
s/tiger/wolf/' -e 's/after/before/'
The wolf cubs will meet on Tuesday before school
$
或
$ echo The tiger cubs will meet on Tuesday after school | sed '
s/tiger/wolf/; s/after/before/'
The wolf cubs will meet on Tuesday before school
$
注意分号必须是紧跟斜线之后的下一个字符。如果两者之间有一个空格,操作将不能成功完成,并返回一条错误消息。
sed 编辑器在找到一个要修改的项目并作了修改之后继续处理下一行,而不读整行。这意味着它们都处理每一行中出现的第一个选定序列。为了替换出现的每一个项目,在同一行中出现多个要替换的项目的情况下,您必须指定在全局进行该操作:
$ echo The tiger cubs will meet this Tuesday at the same time
as the meeting last Tuesday | sed 's/Tuesday/Thursday/g'
The tiger cubs will meet this Thursday at the same time
as the meeting last Thursday
$
- linux命令-- ps命令
- 【linux命令】cd命令
- linux命令:crontab命令
- Linux 命令 --- df命令
- linux命令-touch命令
- 【linux命令】tr命令
- LINUX命令:more命令
- cmd命令,linux命令
- Linux命令-tar命令
- linux命令:wc命令
- linux命令:more命令
- linux命令:gzip命令
- linux命令:du 命令
- linux命令:wc命令
- Linux命令: PS命令
- Linux命令:wc命令
- Linux命令:lsof命令
- Linux命令:rm 命令
- 无所不能的ant
- 常用的Ant模板(BUILD.XML)
- 华为三层以太网交换机基本原理及转发流程
- 反射
- linux下的c语言/网络/网络编程面试题
- linux命令
- 系统无法正常开机了,弹出“NTLDR is missing…”的信息
- 我的blog
- C#学习笔记:.NET Remoting
- ICE概要
- C#常见面试题,考核一下~
- How to make linux boot from network
- 范伟—“经典爆笑语录全集(上)
- java面向对象浅析系列2——抽象类、接口与多继承