Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Search this Thread
Old 04-20-2012, 03:05 AM   #1
LQ Newbie
Registered: Jun 2011
Distribution: Oracle, BackTrack
Posts: 28

Rep: Reputation: Disabled
How to Copy Terminal Output to a File

I am using backtrack & a particular s/w (fierce) generates a lot of output on the terminal. I actually want to get this entire output to a txt file but i don't know how to do it. I know i can redirect the output to a file but i dn't want to do it for every command. also the output is very large (varies from 50 - 1000 lines based on the command) that most of the time i can't do copy-paste thing, as earlier commands are not visible (i hope u understood)
if u'll use putty or HT in windows, it has options by which all the activities on the terminal can be saved in txt file.

is there anything i can do???
Old 04-20-2012, 07:03 AM   #2
Satyaveer Arya
Senior Member
Registered: May 2010
Location: Dehradun, Uttarakhand, India
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,412

Rep: Reputation: 303Reputation: 303Reputation: 303Reputation: 303
If you're using the terminal then the only option is to direct the output of commands in files.
Old 04-20-2012, 11:39 AM   #3
Registered: Dec 2011
Posts: 108

Rep: Reputation: 6
use the tee command eg
ls -l /root | tee /tmp/rootls
this will out put your command to screen and files but if you want to create file only then do
ls -l /root >> /tmp/rootls
Old 04-20-2012, 12:01 PM   #4
Senior Member
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,730

Rep: Reputation: 1262Reputation: 1262Reputation: 1262Reputation: 1262Reputation: 1262Reputation: 1262Reputation: 1262Reputation: 1262Reputation: 1262
maybe the script command is what you are looking for
Old 04-20-2012, 04:49 PM   #5
Registered: Mar 2008
Posts: 11,521

Rep: Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404Reputation: 1404
Use of fierce.

"It provides different techniques to gather information about your victim."
Old 04-20-2012, 04:53 PM   #6
Registered: Aug 2011
Distribution: Slackware 14, Debian 7.0.0 Wheezy, Windows 7, Windows 8
Posts: 116

Rep: Reputation: Disabled
just use ">" between output command and desired filename.

eg. if you want output of a.out in file output.txt, use
./a.out > output.txt
and to append use ">>"

hope it helps!

Last edited by unkn(0)wn; 04-20-2012 at 04:59 PM.
Old 04-21-2012, 05:43 AM   #7
LQ Newbie
Registered: Jun 2011
Distribution: Oracle, BackTrack
Posts: 28

Original Poster
Rep: Reputation: Disabled
Ok, then i m left with the option of redirecting & appending the output

anyway, thanks everyone


backtrack, terminal

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
copy/paste output from shell (not terminal) bluegospel Linux - Newbie 13 07-21-2010 01:37 PM
file copy by terminal manomohan Ubuntu 6 05-29-2007 09:44 PM
file copy by terminal manomohan Linux - Networking 1 05-24-2007 07:04 AM
Redirect terminal output to file AND terminal shan Linux - General 3 09-29-2006 08:36 AM
Copy output of Terminal Buffer tryangle Debian 2 08-08-2005 04:09 PM

All times are GMT -5. The time now is 01:26 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration