LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 05-27-2017, 06:26 PM   #1
robertkwild
Member
 
Registered: Feb 2015
Posts: 382

Rep: Reputation: Disabled
why is tar file showing different files/size to directory


hi all,

why am i getting different file counts and different size for the same directory and tar file, they are the same directory i have made into a tar so i really dont get it

tar -tf /vol/cha-archive/audio/Even\ When\ I\ Fall\ -\ January\ 2017\ Project.tar | wc -l
8536

root@archive:/ # find /vol/cha-work/_ARCHIVE/to_be_archived/audio/chad_r/2017-05-17/Even\ When\ I\ Fall\ -\ January\ 2017\ Project/ -type f | wc -l
8464

137G /vol/cha-archive/audio/Even When I Fall - January 2017 Project.tar

138G /vol/cha-work/_ARCHIVE/to_be_archived/audio/chad_r/2017-05-17/Even When I Fall - January 2017 Project/

many thanks,

rob
 
Old 05-27-2017, 08:11 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
The tar archive will include directory names. The output from "find ... -type f" will not include directory names.

In a tar archive, then entry for a directory is just a header with the directory name and its attributes. The actual directory content (file names, inode numbers, ...) is not stored there. The actual directories on the disk do include that information. Usually, though, the tar archive is somewhat larger because every name in that archive has a 512-byte header. But, a directory that at one time contained a large number of entries can be quite large on the disk. A directory never shrinks when files are deleted. That excess space would not be present in the tar archive.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script Issue with Tar Command: Either tar file created in wrong directory or not at all JockVSJock Linux - Newbie 4 06-09-2016 10:18 PM
[SOLVED] Store the size of largest file from a file/directory listing into variable SIZE lainey Linux - Newbie 3 11-15-2011 12:29 PM
Script to delete files with 0k file size in a directory justgiver Linux - Newbie 4 01-28-2008 04:56 AM
i want to print all the files in a directory and the file size in a same line naveen245 Programming 3 12-06-2005 08:22 AM
showing contents of a tar.Z file jpostma Linux - General 1 11-12-2003 05:14 AM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 09:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration