LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 01: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, 01:13 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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 01:19 PM.
 
Old 01-19-2007, 04:28 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 11: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, 12:31 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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 12:33 PM.
 
  


Reply


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


All times are GMT -5. The time now is 03:43 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration