CTRL+R allows me to reverse search through the command history which is great but can I also find out from which directory that command was run? I am using C-shell in Linux.


No. I assume you're using bash as a shell. Then the history is stored in ~/.bash_history. And if you cat that file, you'll see, that it only contains the lines as you entered them.

  • I am using C-shell
    – Geek
    Jul 31 '13 at 14:58
  • 3
    @Geek - doesn't matter, this isn't possible.
    – slm
    Jul 31 '13 at 15:00

If you type history you will get a history of the commands you issued. You can locate the command you want and look at the entries above to see what cd commands are there. This may give you the information you need.

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.