1. Save the file as “.inputrc” (don’t forget to include the dot at the beginning) in your Home folder.
  2. Now open your terminal. You can type a few characters and use the Up/Down arrow to search the history that begin with the typed character. For example, if you type “cd /” and press the Up arrow button, it will search your history for commands that start with “cd /“. Note: If you are using zsh, this feature is already included and you can use it without any modification.