Super User is a question and answer site for computer enthusiasts and power users. 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

I was working when I noticed a file in my homedir called d.txt. It contained all of my iPython work I'd been doing in the last hour or so. Is this something that my Terminal app did, or something that iPython did?

share|improve this question
up vote 2 down vote accepted

Bash saves history for you, in a file determined by the environment variable HISTFILE. Usually it's set to $HOME/.bash_history. What does echo $HISTFILE say?

share|improve this answer
I checked my bash history and it had no mention of the word script, and my Terminal scroll back (set at 100000 lines) didn't appear to have it either :/ – orokusaki May 18 '12 at 16:09
@orokusaki What is $HISTFILE pointing to? Is it set to d.txt? If so, that's where the file came from - bash saving normal history to the file. – Rich Homolka May 18 '12 at 16:21
no, it points to ~/.bash_history – orokusaki May 18 '12 at 16:22

you must have typed script d.txt at some point, or the equivalent. this will record all your commands in the terminal to the file.

share|improve this answer
johnshen64 - is it possible for a program to cause this to happen (like iPython)? I'm sure I haven't typed script in my shell, and certainly not script d.txt. – orokusaki May 18 '12 at 15:39
yes, a program could capture terminal output or shell histor as rich mentioned and store it in a file. is the file still growing or at least open? if so you can us lsof to find the owner program of the file. – johnshen64 May 18 '12 at 16:00
unfortunately, I deleted the file :( it appeared to have stopped recording input (based on what I saw in the contents) at about 10 minutes before I noticed it. – orokusaki May 18 '12 at 16:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .