LinuxQuestions.org
Social Bookmarking all things Linux and Open Source
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This 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
 
Thread Tools
Old 06-27-2007, 02:57 AM   #1
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat ,Fedora&CentOS
Posts: 491
Thanked: 0
Diffrernce between cat and zcat


[Log in to get rid of this advertisement]
Hi,
Can anyone explain me the difference between "cat" and "zcat " command.
Thanks
ZAMO is offline     Reply With Quote
Old 06-27-2007, 03:00 AM   #2
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 12,881
Thanked: 232
Zcat is used to cat compressed files. For example, try "zcat /proc/config.gz | grep RAID"
jschiwal is offline     Reply With Quote
Old 06-27-2007, 03:00 AM   #3
b0uncer
Senior Member
 
Registered: Aug 2003
Location: fin
Distribution: (B)LFS, Ubuntu, Slackware
Posts: 4,854
Thanked: 27
zcat can take in compressed data, cat uses non-compressed, that's the difference I think.
b0uncer is offline     Reply With Quote
Old 06-27-2007, 03:08 AM   #4
ZAMO
Member
 
Registered: Mar 2007
Distribution: Redhat ,Fedora&CentOS
Posts: 491
Thanked: 0

Original Poster
Thank you for your replies
ZAMO is offline     Reply With Quote
Old 06-27-2007, 08:15 PM   #5
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora Core, Slackware, Debian, Ubuntu Jaunty
Posts: 251
Thanked: 8
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)
bartonski is offline     Reply With Quote
Old 06-27-2007, 10:31 PM   #6
DeuceNegative
LQ Newbie
 
Registered: May 2006
Location: Boston, MA
Distribution: Gentoo
Posts: 29
Thanked: 0
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)
DeuceNegative is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
how can i do cat? ZAMO Linux - General 6 05-04-2007 01:52 AM
Zcat broken? keysorsoze Solaris / OpenSolaris 3 03-28-2007 02:01 AM
cat in asm/ cat --show-all option Tux Linux - Software 1 09-02-2006 10:31 PM
Cat intervade Linux - Newbie 7 05-21-2006 03:18 PM
Cat ... Beuzekom Linux - Newbie 4 01-19-2004 06:32 PM


All times are GMT -5. The time now is 09:41 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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration