Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

Your Answer

 
discard

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.