我刚刚在 bash 中运行了以下命令:
uniq .bash_history > .bash_history
我的历史文件最终完全是空的。
我想我需要一种在写入文件之前读取整个文件的方法。这是怎么做的?
PS:我显然想过使用临时文件,但我正在寻找更优雅的解决方案。
linux bash
bash ×1
linux ×1