Find the answer to your Linux question:
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 ...
  1. #1
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493

    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?????

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    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!"

  3. #3
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493
    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?

  4. #4
    Linux Engineer Kieren's Avatar
    Join Date
    Aug 2007
    Location
    England
    Posts
    845
    If you don't understand what a command is doing you can check the manual for it by typing:

    Code:
    man <command>
    For instance to see the manual page for zcat type:

    Code:
    man zcat
    Linux User #453176

  5. #5
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493
    I understand what it is doing but m having some tough time understand ing the o/p.

  6. #6
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    Quote Originally Posted by vickey_20 View Post
    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?
    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!"

  7. #7
    Linux 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?

  8. #8
    Linux Guru Rubberman's Avatar
    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
    Quote Originally Posted by vickey_20 View Post
    [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?????
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...