history -r
r Remove a trailing suffix of the form .xxx, leaving the basename.
来自文档:
读取历史文件并将其内容追加到历史列表中。
可以使用 History 命令将自定义文件加载到 Bash 历史记录中。现在,当您使用
正如 Rahul Tripathi 所说,
有关
r
Modifiers
$ echo foo.bar foo.bar $ echo !$:r foo