Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer

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.

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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