Results 1 to 8 of 8
[root@localhost test]# ll
total 16
-rw-r--r-- 1 root root 22 Apr 6 15:30 a
-rw-r--r-- 1 root root 22 Apr 6 15:30 b
-rw-r--r-- 1 root root 22 Apr 6 ...
- 04-06-2009 #1
zcat command o/p not understandable
[root@localhost test]# ll
total 16
-rw-r--r-- 1 root root 22 Apr 6 15:30 a
-rw-r--r-- 1 root root 22 Apr 6 15:30 b
-rw-r--r-- 1 root root 22 Apr 6 15:30 n
-rw-r--r-- 1 root root 165 Apr 6 17:52 small.gz
[root@localhost test]# zcat small.gz
a0100644000000000000000000000002611166351277007727 0ustar rootrootthis is a sample file
b0100644000000000000000000000002611166351302007715 0ustar rootrootthis is a sample file
n0100644000000000000000000000002611166351304007733 0ustar rootrootthis is a sample file
I just gave this command on the terminal but dont understand the o/p?????
- 04-06-2009 #2
You don't say how you made the small.gz file. Somehow you got the actual 'test' directory into it. What you are seeing is a print-out of the contents of the directory file (which is something you don't often see!). The 644 corresponds to the permissions shown by ls and the 611166351 is clearly the date.
"I'm just a little old lady; don't try to dazzle me with jargon!"
- 04-06-2009 #3
thanks for replying, I made the small.gz file using gzip command inside the test directory.
the small.gz contains the a,b,c file in it. But it don't understand what zcat is supposed to do ? and also how do you know that 611166351 is the date . If it is then in which format?
- 04-06-2009 #4
If you don't understand what a command is doing you can check the manual for it by typing:
For instance to see the manual page for zcat type:Code:man <command>
Code:man zcat
Linux User #453176
- 04-06-2009 #5
I understand what it is doing but m having some tough time understand ing the o/p.
- 04-08-2009 #6
I don't know for certain but I am guessing because all these files have the same date/time and this string of digits is also constant for all three. The internal format for date and time is actually so many seconds after a standard zero (I believe the beginning of 1970).
Actually the data in your .gz file doesn't come from the directory itself but from the little data structures known as inodes which contain all the information about a file including its age, permissions and ownership. Each file has one. The directory just maps the file names to inode numbers. But I still don't understand how these inode listings got into your file. Can you tell us the exact command you used (the complete command string)?"I'm just a little old lady; don't try to dazzle me with jargon!"
- 04-08-2009 #7Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
zcat is equivalent to gunzip -c, as the man page says. And -c is used to dump the output of gunzip to stdout (usually your screen), instead of a file.
What that output is will entirely depends on whatever the gz file contains, which in turn will depend on whatever the original files contained. Since you are being very vague about how you created the gz file, we can't be any more specific either.
You say that you created it from a, b and n, but gzip only compress single files, so you must have used some way to concatenate them. Duh?
- 04-14-2009 #8Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,970
As mentioned by i92guboj, zcat is the equivalent of gunzip -c, which dumps output to stdout (your terminal). For binary files, this is gibberish. If you want to uncompress it, then run the command gunzip small.gz, or zcat small.gz >small, the resulting file "small" will contained the uncompressed data.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
