1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-13 05:35:23 +02:00
tldr/pages.zh/common/^.md
Sebastiaan Speck 9185fbf1fe
pages*/common: allow character in title (#16805)
Co-authored-by: Darío Hereñú <magallania@gmail.com>
2025-06-10 06:24:18 +02:00

21 lines
634 B
Markdown

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