HIstory command only showing last 15 commands

Viewed 20756

I enter the command history It shows the last 15 commands, where are the previous 988 commands.

  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

Even if I grep them history | grep 'rm' for something I know I did, none of the previous commands show up

If I continue to enter terminal commands the numbers go up but I'm still limited to only 15. (command 995-1010 will be shown for example

It continues happening when I close the end the terminal app and reopen it

The terminal is zsh on MacOS Catalina

2 Answers

The history n command, where n is a number shows all history since line n. So in your case, history 904 will show the last 100 commands.

I'm using zshon my ubuntu and when I run history it shows me 285 commands, all the history so far. Don't know what's happening but pretty sure it wasn't supposed to do that. I'm using Oh my Zsh, don't know if that helps.

Related