Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Clear the text buffer in Terminal.app

I have searched and can't find a solution to this. Here's what I want to do in a single terminal window:

* run command1
* Shell > Export Text As . . . file1.txt
* run command2
* Shell > Export Text As . . . file2.txt


But I want file2.txt to have ONLY the output of command2.

As it is, the Export Text As function seems to be infinitely cumulative. But I want to separate out the output into different files without having to close my Terminal window and start a new session.

Please don't respond with suggestions of piping output to a file or other such. I'm working with proprietary tools that prevent me from doing things like that. The only way I have to collect the data I need is thru Export Text As . . .

I'm running OSX 10.5.4, Terminal 2.0.1(240).

Thanks very much

iMac, Mac OS X (10.4.11)

Posted on Aug 24, 2008 12:41 PM

Reply
5 replies

Aug 24, 2008 3:40 PM in response to Gorgan J

I think you'll find that 'Export Text As' saves the entire window contents. Therefore it isn't the case that it is appending data to the file, but that what you're writing out includes both the first and second commands.

As previously mentioned you could clear the scrollback buffer between commands, but I don't know a way to do that programmatically in the shell (other than via osascript, maybe. The only other way I can see around this is to use separate windows for each command but you said you don't want to do that.

Clear the text buffer in Terminal.app

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.