I am using zcat to output the contents of a rather large .gz compressed text file. I am piping the output to grep and searching for a specific string. Below is the command I am running.
dylan@xaelah:/media/dylan/ExtHD$ zcat wpaPasswords2.gz | grep baconisdelicious
The command runs for a while and then exits with the following error.
gzip: wpaPasswords2.gz: unexpected end of file
I have also tried piping the output to the tail command, which with default options it completes with output, but not with the last 10 lines of the compressed files, it outputs 10 lines but not the last 10 lines. If I pipe the output to 'tail -n 1' such as:
dylan@xaelah:/media/dylan/ExtHD$ zcat wpaPasswords2.gz | tail -n 1
I get the same error message of
gzip: wpaPasswords2.gz: unexpected end of file
While the command runs I watch the output of htop and the bottle neck is I/O, the computer is not running out of ram so I am unclear of how exactly to determine what the cause of this issue is. I have checked the logs and have not found anything of value.
The reason I am trying to do all of this is because I am going to combine several very large .gz files while sorting them and removing duplicates however I want to make sure my process will work before running my scripts over gigs and gigs of data. Any advice would be appreciated, thanks!
gzip -t wpaPasswords2.gz
say? – Stephen Kitt Mar 10 '15 at 05:33.gz
containing what's left is to rungunzip -c wpaPasswords2.gz > wpaPasswords2
(make surewpaPasswords2
doesn't exist first) followed bygzip wpaPasswords2
(confirming that you want to overwritewpaPasswords2.gz
). You might want to copywpaPasswords2.gz
somewhere safe before you do this... – Stephen Kitt Mar 10 '15 at 06:23