linux - 如何在不记录历史记录的情况下在 bash 中执行命令?

标签 linux bash history

<分区>

我已经看到在没有将其记录在历史记录之前运行带有空格的命令(至少是命令) 但 PopOS 似乎并非如此

它在 Ubuntu 中有效,但在 PopOS 中无效。 有没有我可以尝试的解决方法或其他技巧

$ls
$history
 1 ls
 2 history
$ pwd #there's a space preceding this command
$history
 1 ls
 2 history
 3 pwd
 4 history

在 Ubuntu 中工作但在 POPOS 中不工作

最佳答案

为此使用集合:

 set +o history
    do your command you want to be ignored
 set -o history
    now your commands will be stored to history again

关于linux - 如何在不记录历史记录的情况下在 bash 中执行命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58576626/

相关文章:

c++ - C++ 跨平台的 Base64 编码/解码库?

bash - Kubernetes-使用kubenetes API在重启或关闭之前从节点删除所有Pod

linux - 有关 Linux 和开源的视频

bash - 防止重复项保存在 bash 历史记录中

Android - 在 Activity 之间导航时清除历史记录

linux - 段错误 - 如何调试?

mysql - 如何通过linux shell脚本执行sql命令?

linux - 如何在 Unix 命令的两列中获取相同值的唯一值

regex - 仅打印配置文件中特定部分的行

c++ - 如何将我的 cli 信息(变量等)共享给子进程(bash shell 脚本)