7

I am using 'iterm' as my terminal at macosx. But I don't see all my command I type when I do 'history' and I don't see my previous command (copy and paste) using the UP arrow key?

Is there a way to fix it?

3
  • Can you give us a repeatable example? – Bill Reardon Dec 5 '09 at 8:10
  • 2
    History is handled by your shell (most likely GNU bash), not by your terminal program. – Tadeusz A. Kadłubowski Dec 5 '09 at 11:05
  • I have same problem – juanpablo Jul 10 '11 at 5:41
8

Check you home dir in iTerm.

$ cd ~
$ ls -la | grep .bash_history

If the above command found the file you can do the following command

$ cat .bash_history

This will show your history. Not in the exact same format as 'history' but it will do I think. Or you can search within your history with the shortcut CTRL + r. It will show something as (reverse-i-search). Type your command you did earlier and it will return a result.

Note: Some terminals have a different shell. For instance zsh. If that's the case you need to search .zsh_history

2
  • 3
    Bear in mind that if you use a bash alternative, you'll need to use it's history equivalent e.g. with ZSH, replace .bash_history with .zsh_history. – saywhatnow Aug 19 '18 at 23:49
  • Give that man a Nobel Peace Prize. – Jonathan Aug 31 '19 at 0:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.