verify tar archive

have one more doubt regarding tar command. i have extracted the tar file, say test.tar , to the folder "ABC".
Now i removed some files and changed the contents of some other files in the folder "ABC".
Is there any way to check the files in the folder "ABC" aganist the test.tar.
In short, what is the way to VERIFY the contents of extracted tar file against tar file
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian ParkerSenior Systems AdministratorCommented:
You could list the contents of the tar file and compare the files to an ls -al output.

I dont believer there is a specific verify option in tar.
1) Create directory "ABCD"
2) Extract tar file to "ABCD"
3) Run 'diff' or 'dircmp" on "ABC" and "ABCD" as in dircmp -s ABC ABCD

Hope this does it.
Good Luck
You are asking two seperate questions.  The first is comparing the files on the system to those in the tar file and the second is verifying the tar file.

To verify the validity of the tar file, do

tar tf file.tar

If it is corrupted, you'll get a tar error.

To compare the files on the system against the files in the tar file, extract the tar file to a temporary location, eg:

cd /tmp
tar xvf file.tar
dircmp /tmp/ABC /real/locations/ABC

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
To me, you seem to be asking only one question which was already answered.
conversekidAuthor Commented:
Hi 97WideGlide:,
I am afraid I dint really understand what you are saying..

However thanks everyone for you help..

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.