Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HIstory command only showing last 15 commands [duplicate]

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

like image 843
Sam Avatar asked Apr 10 '20 19:04

Sam


People also ask

How do I get full history in terminal?

Simple Command History Navigation The easy way to get started with your command history is to simply navigate with the up and down arrow keys. Using the up key, you can scroll through previous commands one command at a time. To scroll back down the list, you can use the down arrow key.

How can I see all commands in history?

Type “history” (without options) to see the the entire history list. You can also type ! n to execute command number n.

What is the command to show my last 16 commands from my history?

Use the history command to list commands that you have previously entered. The history command is a Korn shell built-in command that lists the last 16 commands entered. The Korn shell saves commands that you entered to a command history file, usually named $HOME/. sh_history.

How do I view full command history on Mac?

To view your entire Terminal history, type the word “history” into the Terminal window, and then press the 'Enter' key. The Terminal will now update to display all the commands it has on record.


1 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.

like image 156
Meredith Avatar answered Sep 24 '22 04:09

Meredith