How zcat works? | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

How zcat works?

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-31-2012
pandeesh's Avatar
pandeesh pandeesh is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 4 August 2014, 12:48 PM EDT
Posts: 322
Thanks: 77
Thanked 12 Times in 12 Posts
How zcat works?

Hi,

just i would like to know, how will be the response if you try to read a 40GB compressed file using zcat.
a)Uncompress the 40GB file and have it in the disk. use cat to view the steps.
b)Use zcat directly to view the compressed file?

What are the steps being occurred in step (b)?
Where does actual compression takes place?
Which one is the best way to handle this scenario?

Thanks
Sponsored Links
    #2  
Old 12-31-2012
pamu pamu is offline
Registered User
 
Join Date: Mar 2012
Last Activity: 20 August 2014, 7:37 AM EDT
Posts: 1,649
Thanks: 58
Thanked 478 Times in 474 Posts
Daily I works with .gz files, so I always need to use zcat .

I normally don't have a file with 40GB. I'll be having around 25-50 files of size 20-30 MB.

so I use.


Code:
zcat *.gz | #choose what i want to do.

But the important question is what you are trying to achieve with that file..?
Sponsored Links
    #3  
Old 12-31-2012
pandeesh's Avatar
pandeesh pandeesh is offline
Registered User
 
Join Date: Jul 2011
Last Activity: 4 August 2014, 12:48 PM EDT
Posts: 322
Thanks: 77
Thanked 12 Times in 12 Posts
Hi Pamu,
Thanks for your response.
Just i wanted to know, whether zcat is recommended for large files(more than 40GB).
I wanted to implement compressed loading in oracle while using external table load strategy.
For that i need to have zcat in bin directory. just i suspect how zcat will behave for huge files.
And also i want to understand the internal implementation of zcat.
i believe zcat should un-compress the original file intermediately somewhere and read.
although we don't see any impact in small files, i want to make sure the impact for the huge files.

thanks
    #4  
Old 12-31-2012
pamu pamu is offline
Registered User
 
Join Date: Mar 2012
Last Activity: 20 August 2014, 7:37 AM EDT
Posts: 1,649
Thanks: 58
Thanked 478 Times in 474 Posts
Quote:
Originally Posted by pandeesh View Post
And also i want to understand the internal implementation of zcat.
i believe zcat should un-compress the original file intermediately somewhere and read.
although we don't see any impact in small files, i want to make sure the impact for the huge files.
Yes. It uses temp memory to perform un compression work.

So the impact might be how much load it will ask to do the things. I believe while performing zcat oparations on a big file, there is large chances that system will throw low memory space error.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
BASH ZCAT EGREP Shell Script metallica1973 Shell Programming and Scripting 8 10-23-2012 01:24 PM
zcat two files jacobs.smith Shell Programming and Scripting 11 10-04-2012 12:28 PM
>./a.pl works, >a.pl - does not zzol UNIX for Dummies Questions & Answers 4 02-03-2009 11:09 AM
zcat on Linux felixmat1 Linux 2 06-19-2008 03:42 PM
zcat --> Arg list too long muneebr UNIX for Dummies Questions & Answers 3 08-19-2004 04:40 AM



All times are GMT -4. The time now is 10:12 PM.