macos - HIstory 命令只显示最后 15 个命令

标签 macos shell command-line terminal zsh

这个问题在这里已经有了答案:





zsh history is too short

(3 个回答)


去年关闭。




我输入命令 history它显示了最近的 15 个命令,以前的 988 个命令在哪里。

  989  yarn android
  990  /Dir/firebase_dummy_app/chatroom/node_modules/react-native/scripts/launchPackager.command ; exit;
  991  yarn android
  992  source ~/.bashrc
  993  cd Documents
  994  ls
  995  rm -rf firebase_dummy_app
  996  expo init
  997  cd firesbaseDummy
  998  yarn android
  999  cd ..
 1000  rm -rf firesbaseDummy
 1001  /Dir/firesbaseDummy/node_modules/react-native/scripts/launchPackager.command ; exit;
 1002  /Dir/firebaseChat/node_modules/react-native/scripts/launchPackager.command ; exit;
 1003  history
 1004  history

即使我grep他们history | grep 'rm'对于我知道的事情,之前的命令都没有出现

如果我继续输入终端命令,数字会增加,但我仍然仅限于 15。(例如,将显示命令 995-1010

当我关闭终端应用程序并重新打开它时,它会继续发生

终端是 MacOS Catalina 上的 zsh

最佳答案

history n命令,其中 n是一个数字,显示自第 n 行以来的所有历史记录。所以在你的情况下,history 904将显示最后 100 个命令。

关于macos - HIstory 命令只显示最后 15 个命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61147042/

相关文章:

xcode-选择事件开发人员目录错误

iphone - Lua 和 os.execute 返回

windows - Git pull 无法更新本地引用

svn - 通过命令行更新本地 SVN 存储库

objective-c - 如何在 MAC 中获取连接的以太网或 WiFi 的 IP 地址

python - 尝试导入 opencv 时出现段错误和崩溃

linux - 如何从(bash)脚本以跨平台方式获取/设置修改时间?

node.js - npm 模块实现包装 shell 命令的模式?

c++ - 命令行参数类似于 C++ 中的用户输入

mysql - Ruby on Rails - 无法打开 mySQL 命令行