bash – Unix命令行历史替换^ foo ^ bar(用于多个替换)

前端之家收集整理的这篇文章主要介绍了bash – Unix命令行历史替换^ foo ^ bar(用于多个替换)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
偶尔使用bash命令替换上一个命令中的字符串:
^foo^bar

今天我想用下面的代替替换所有出现的复选框与`radio

$ git mv _product_checkBox_buttons.html.erb _product_checkBox_button.html.erb
$ ^checkBox^radio
git mv _product_radio_buttons.html.erb _product_checkBox_button.html.erb

所以它只取代了第一次发生。如何使其替代所有的事件?

bash --version
GNU bash,version 3.2.48(1)-release (x86_64-apple-darwin10.0)
Copyright (C) 2007 Free Software Foundation,Inc.
男人bash说^ old ^ new相当于!!:s / old / new /。你想!!:gs / old / new /来全局替换。
原文链接:https://www.f2er.com/bash/388487.html

猜你在找的Bash相关文章