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?

4
  • 3
    You may find this helpful: stackoverflow.com/q/945288/2100043 Commented Jul 9, 2013 at 20:54
  • 1
    Per-directory history in zsh may be interesting, if you're ok with switching to zsh. Commented Jul 9, 2013 at 21:07
  • @Gilles:I have never used zsh.Is it separate download?Does it work ok with screen or tmux? Commented Jul 9, 2013 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. The two work equally well in screen or tmux. Commented Jul 9, 2013 at 21:32

1 Answer 1

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):

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.