LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 01-19-2007, 12:01 PM   #1
ashishjen
LQ Newbie
 
Registered: Jan 2007
Posts: 25

Rep: Reputation: 15
saving to file


when we install some package then their are some commands which are shown on the console but we cant see all of them when they are more than a limit. i wanted to know that how can we save th efull info which has been displayed without loosing even a single word...
 
Old 01-19-2007, 12:13 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Redirection is your friend....

When you run any Linux command, you can redirect any output to a file. You will want to read up on this, because some options are not intuitively obvious.

Simple example:
Read a file named "stuff" and put the output in a new file named "mystuff":
cat stuff >mystuff

when you run certain commands you can have normal output + error messages. Te be sure that it ALL goes to a file, you need to redirect the "stderr" stream also--like so
cat stuff >mystuff 2>myerrors
There are also ways to get stdout and stderr to go to one file

The book I recommend for this kind of thing is the Bash Guide for Beginners, by Machtelt Garrels. It is at tldp.org

Last edited by pixellany; 01-19-2007 at 12:19 PM.
 
Old 01-19-2007, 03:28 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Alternatively a pipe into tee is a good choice, too. Lets you
eat the cake AND have it :}

command 2>&1 | tee output.txt



Cheers,
Tink
 
Old 01-22-2007, 10:49 AM   #4
ashishjen
LQ Newbie
 
Registered: Jan 2007
Posts: 25

Original Poster
Rep: Reputation: 15
as said above i am not able to see the progress on the terminal . i actually want that along with display on screen i can get redirection also..

any idea's....
 
Old 01-22-2007, 11:31 AM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
I highly recommend re-reading my previous post.

As I said above: tee does exactly that.


Cheers,
Tink

Last edited by Tinkster; 01-22-2007 at 11:33 AM.
 
  


Reply



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
saving a file in emacs Lorend Linux - General 2 08-19-2006 04:55 PM
saving file blackzone Programming 5 01-21-2005 05:51 PM
saving file darkangel29 Linux - Newbie 2 11-25-2004 01:16 PM
Saving as a file in C++ dfownz Programming 3 07-03-2004 08:39 AM
Saving file as PDF crash89 Linux - General 2 09-05-2001 09:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:57 PM.

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