Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-12-2007, 01:59 PM   #1
LQ Newbie
Registered: Jun 2007
Posts: 6

Rep: Reputation: 0
Redirecting output to a compressed file

i have a process which produces a lot of output. How would i compress this output on the fly in order to conserve disk space? how would i do this?
Old 06-12-2007, 02:34 PM   #2
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Where is it going now?---one big file?

Quick poking around says that you cannot pipe to tar, but you can to gzip.

eg, this works:

cat file | gzip >newfile

So you could pipe the output of your process to gzip, but how would it know when to quit (and close the file)?
Old 06-12-2007, 02:36 PM   #3
LQ Newbie
Registered: Jun 2007
Posts: 6

Original Poster
Rep: Reputation: 0
right now i redirect to a file..

./program < /dev/null >> stdout.$(date +%Y%m%d).txt 2>&1
Old 06-13-2007, 08:51 AM   #4
LQ Newbie
Registered: Jun 2007
Posts: 6

Original Poster
Rep: Reputation: 0
I think i figured it out.. I created a node file ( fifo ) and then redirect the output to gzip..

mknod pipe.txt p
./program > pipe.txt
gzip < pipe.txt > info.gz


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
Redirecting socket output to a file elmafiacs Programming 1 10-15-2005 06:18 AM
Redirecting colsole output to file. danimallv Linux - General 4 07-05-2005 03:44 PM
why when redirecting output to a file any file extension seems to be fine? dr_zayus69 Linux - General 1 05-21-2005 05:09 AM
redirecting output of compile to a file halfcan Linux - Hardware 1 02-05-2005 11:01 PM
redirecting cpio screen output to file rawii Solaris / OpenSolaris 1 02-11-2004 10:28 AM > Forums > Linux Forums > Linux - Software

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