sed '12s/s/6/5/' 111.txt
时间: 2023-10-01 14:09:34 浏览: 51
This command will replace the first occurrence of the letter "s" with the number "6" on line 12 of the file "111.txt" and then replace it with the number "5".
相关问题
sed 's/././/'
这个sed命令的作用是将每行的第一个字符替换为点号。下面是一个演示例子:
假设我们有一个文件file.txt,内容如下:
```
apple
banana
cherry
```
我们可以使用以下命令来执行替换操作:
```shell
sed 's/././/' file.txt
```
执行结果如下:
```
.pple
.banana
.herry
```
这个命令将每行的第一个字符替换为点号。
sed 's/.//'
这是一个sed命令的示例,用于删除每行开头的第一个字符。
具体命令解释如下:
- `s/.//`:这是一个替换命令,用于替换每行开头的第一个字符。其中,`s`表示替换操作,`.//`表示将匹配到的第一个字符替换为空字符(即删除)。
通过这个命令,你可以删除每行开头的第一个字符。
请注意,在实际使用时,你需要将命令中的输入文件或者输入流作为sed命令的输入,并将输出结果输出到终端或者其他文件。
希望这个解释对你有帮助!如果还有其他问题,请随时提问。