Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

tar compare or diff command line

Writer Mia Lopez

What is wrong with this?

tar --diff --gunzip --file=/media/disk/filename.tgz

This is GNU tar 1.23 on Ubuntu. The complaint is gzip:stdin:input/output error.

The following just hangs and there is no apparent disk seek activity.

tar --diff fz /media/disk/filename.tgz
tar --compare fz /media/disk/filename.tgz
tar -d vfz /media/disk/filename.tgz

2 Answers

It has to be --gzip or -z, but not gunzip.

Also, in your second code block. If you give the f argument, there has to follow the file:

tar --diff zf /media/disk/filename.tgz
tar --compare zf /media/disk/filename.tgz
tar -d vzf /media/disk/filename.tgz

All of them work. Notice that I moved the f argument right before the filename.

tar --compare --verbose -z --file=filename.tgz ./directory > logfile

This or some variant worked. The point of redirecting to the logfile is to reduce clutter: the 'file not found' sort of differences stay on the console, the rest go into the logfile. I do not know why the other attempts by the OP did not work.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy