4

I was wondering: If I type history I can see the previous commands I typed and see what happened and perhaps keep commands as reference. But I don't know in which directory I was when I typed the commands.

Is there a version of history that displays also the directory you were in when you typed the command?

slm
  • 363,520
  • 117
  • 767
  • 871
Jim
  • 9,750
  • 15
  • 57
  • 84
  • 3
    You may find this helpful: http://stackoverflow.com/q/945288/2100043 – BriGuy Jul 09 '13 at 20:54
  • 1
    [Per-directory history in zsh](http://unix.stackexchange.com/questions/71189/per-directory-history-in-zsh) may be interesting, if you're ok with switching to zsh. – Gilles 'SO- stop being evil' Jul 09 '13 at 21:07
  • @Gilles:I have never used `zsh`.Is it separate download?Does it work ok with `screen` or `tmux`? – Jim Jul 09 '13 at 21:20
  • @Jim It's a separate program. Most distributions offer it as a package. Zsh is less common, often not part of the default installation, but has more features. The basic syntax is mostly the same, but some advanced features are different, and zsh has [more](http://unix.stackexchange.com/q/983). The two work equally well in screen or tmux. – Gilles 'SO- stop being evil' Jul 09 '13 at 21:32

1 Answers1

2

Following the link about Per-directory history in zsh and then the link in the comment there, two Per-directory history in bash links are provided (one is broken, but corrected here):

András
  • 51
  • 3