LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 06-27-2007, 01:57 AM   #1
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 565

Rep: Reputation: 30
Diffrernce between cat and zcat


Hi,
Can anyone explain me the difference between "cat" and "zcat " command.
Thanks
 
Old 06-27-2007, 02:00 AM   #2
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,262

Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
Zcat is used to cat compressed files. For example, try "zcat /proc/config.gz | grep RAID"
 
Old 06-27-2007, 02:00 AM   #3
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
zcat can take in compressed data, cat uses non-compressed, that's the difference I think.
 
Old 06-27-2007, 02:08 AM   #4
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat &CentOS
Posts: 565

Original Poster
Rep: Reputation: 30
Thank you for your replies
 
Old 06-27-2007, 07:15 PM   #5
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 438
Blog Entries: 1

Rep: Reputation: 47
Quote:
Originally Posted by jschiwal
Zcat is used to cat compressed files. For example, try "zcat /proc/config.gz | grep RAID"
Hmm. That file doesn't exist on my FC4 box. What distro are you using, and what does that file contain? (I understand what the /proc file system is, but I've never run into config.gz)
 
Old 06-27-2007, 09:31 PM   #6
DeuceNegative
LQ Newbie
 
Registered: May 2006
Location: Boston, MA
Distribution: Gentoo
Posts: 29

Rep: Reputation: 15
It contains the running kernel's configuration, just like /usr/src/linux/.config contains the configuration for the kernel that you compile. It might even be exactly that file, gzipped.

In order to have it available, it must be enabled when you configure the kernel (along with procfs, too):
Code:
General setup  --->
[*] Kernel .config support
[*]   Enable access to .config through /proc/config.gz
It corresponds to CONFIG_IKCONFIG_PROC. So if it's working, you could do
Code:
zcat /proc/config.gz | grep CONFIG_IKCONFIG_PROC
and see
Code:
CONFIG_IKCONFIG_PROC=y
(self-referentiality is fun)
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i do cat? ZAMO Linux - General 6 05-04-2007 12:52 AM
Zcat broken? keysorsoze Solaris / OpenSolaris 3 03-28-2007 01:01 AM
cat in asm/ cat --show-all option Tux Linux - Software 1 09-02-2006 09:31 PM
Cat intervade Linux - Newbie 7 05-21-2006 02:18 PM
Cat ... Beuzekom Linux - Newbie 4 01-19-2004 05:32 PM


All times are GMT -5. The time now is 10:18 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration