Files
tldr/pages.zh/common/^.md

21 lines
591 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 插入符号
> Bash 内置命令,用于快速替换上一条命令中的字符串并运行结果。
> 等同于 `!!:s^string1^string2`。
> 更多信息请访问:<https://gnu.org/software/bash/manual/bash.html#Event-Designators>。
- 运行上一条命令,将 `string1` 替换为 `string2`
`^{{string1}}^{{string2}}`
- 从上一条命令中移除 `string1`
`^{{string1}}^`
- 在上一条命令中将 `string1` 替换为 `string2` 并在末尾添加 `string3`
`^{{string1}}^{{string2}}^{{string3}}`
- 替换所有 `string1` 的出现:
`^{{string1}}^{{string2}}^:&`