×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

result of command I am running

result of command I am running

result of command I am running

(OP)
result of command

I am running job which creates a .gz file. e.g. xyz.gz

When I use below command result always vary.

wc -l xyz.gz

count = 30
count =50

does this mean data is also varying in the file ?

RE: result of command I am running

I don't believe using word count on a compressed file makes sense. Anyone else have an opinion?

==================================
advanced cognitive capabilities and other marketing buzzwords explained with sarcastic simplicity


RE: result of command I am running

A Gzip file is a binary file and getting a line count is worthless. What are you actually trying to do? Are you attempting to get the size of the file? (ls -la xyz.gz), Are you seeing if it is different from before (cksum xyz.gz) What exactly are you trying to do by using the wc command

Bill
Lead Application Developer
New York State, USA

RE: result of command I am running

As already mentioned, a Gzip file is a compressed binary file. The "wc -l" command is trying to find lines in a text file. You won't get anything meaningful.

If you want to know how many files are in the .gz file, these commands can do that...

CODE

zipinfo -1 xyz.gz | wc -l

zipinfo xyz.gz | tail -1 

RE: result of command I am running

does this mean data is also varying in the file?

If two files are EXACTLY the same, then their compressed (gz) files should be exactly the same, and the wc command should return exactly the same result. If even 1 byte changes in the file, the wc command could return a different result for each file.

==================================
advanced cognitive capabilities and other marketing buzzwords explained with sarcastic simplicity


RE: result of command I am running

The only way to really know if the 2 files are the same is to compare their checksums.

cksum FILE1
cksum FILE2

Bill
Lead Application Developer
New York State, USA

RE: result of command I am running

What Bill says is true. If you are interested in verifying that the files are identical, his is the only sure solution.

==================================
advanced cognitive capabilities and other marketing buzzwords explained with sarcastic simplicity


RE: result of command I am running

How is that "the only sure solution"? What about

CODE -->

/usr/bin/cmp 
?

RE: result of command I am running

yes cmp will work just fine. The reason that I use cksum almost exclusively is that I store the checksums into a database so that I can make sure that all duplicates never get passed.

Bill
Lead Application Developer
New York State, USA

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close