要查看 cmatrix
命令的历史记录,你可以使用以下几种方法:
history | grep cmatrix
这会显示你之前执行过的所有包含 "cmatrix" 的命令。
cat ~/.bash_history | grep cmatrix
或者对于其他 shell:
cat ~/.zsh_history | grep cmatrix # 对于 zsh 用户
history | grep -i cmatrix | sort -u
这会显示不重复的 cmatrix 命令历史记录(不区分大小写)。
grep -a "cmatrix" ~/.bash_history
如果你想从历史记录中删除 cmatrix 命令:
history -d $(history | grep -m 1 "cmatrix" | awk '{print $1}')
或者删除所有 cmatrix 记录:
history | grep "cmatrix" | awk '{print $1}' | xargs -n 1 history -d
希望这些方法能帮助你查看 cmatrix 命令的历史记录!