Unix Tar - built-in?

kainjow

Registered
Hey there,

Does anyone know if /usr/bin/tar is built-in to Mac OS X or is it required to have the BSD stuff installed from the OS X installation?
 
kainjow said:
Hey there,

Does anyone know if /usr/bin/tar is built-in to Mac OS X or is it required to have the BSD stuff installed from the OS X installation?


/usr/bin $ls -lai tar
189149 -rwxr-xr-x 1 root wheel 174636 27 May 2004 tar


/usr/bin $ls -lai
189144 -r-xr-xr-x 1 root wheel 18308 27 May 2004 sum
189145 -r-xr-xr-x 1 root wheel 14372 16 Dec 01:12 sw_vers
189146 -rwxr-xr-x 1 root wheel 147548 27 May 2004 tack
189147 -r-xr-xr-x 1 root wheel 23392 27 May 2004 tail
189148 -r-xr-xr-x 1 root wheel 26128 27 May 2004 talk
189149 -rwxr-xr-x 1 root wheel 174636 27 May 2004 tar
189150 -rwxr-xr-x 1 root wheel 142828 27 May 2004 tbl
189151 lrwxr-xr-x 1 root wheel 8 29 Dec 20:35 tclsh -> tclsh8.4
189152 -rwxr-xr-x 1 root wheel 13796 16 Dec 01:12 tclsh8.4
189153 -r-xr-xr-x 1 root wheel 14468 27 May 2004 tcopy
189154 -rwxr-xr-x 1 root wheel 36684 27 May 2004 tdbbackup
189155 -rwxr-xr-x 1 root wheel 36332 27 May 2004 tdbdump
189156 -rwxr-xr-x 1 root wheel 40708 5 Nov 23:08 tdbtool
189157 -r-xr-xr-x 1 root wheel 14156 27 May 2004 tee
 
Looks like zip is installed with the BSD stuff.

BTW, you can look for these in the terminal if you want to - I found tar and zip using these commands:

lsbom -s /Library/Receipts/DeveloperTools.pkg/Contents/Archive.bom | grep -w "tar"
lsbom -s /Library/Receipts/BSD.pkg/Contents/Archive.bom | grep -w "zip"

...and lsbom is one of the "built-in" utilities. ;)

If you didn't install the BSD or DeveloperTools packages, then of course you won't be able to search them, but you can look at the other stuff in /Library/Receipts/ all you want to.
 
tar has been part of the default installation of every version of NEXTSTEP, OPENSTEP, Rhapsody and Mac OS X that I've ever seen. The developer tools are not (and have never been) a requirement for using tar.

tar is a universal archiving tool that has been used in the NeXT/Apple community from the start.

The only time you would need to install something extra would be to use it without opening the Terminal. Two apps that have been around since at least OPENSTEP are Scott Anguish's OpenUp and Andrew Stone's PackUp&Go. I keep a copy of both installed on all my OPENSTEP, Rhapsody and Mac OS X systems.
 
Well I need to know what compression utility is installed in all 10.2.7 and up machines, no matter the configuration (it's for my program). Is gzip/gunzip? What's the different between gnutar and tar?

Thanks.
 
kainjow said:
no matter the configuration
tar, gzip and pax are installed on all Mac OS X systems. Apple used to use tar and gzip within packages (.pkg files), but changed to pax and gzip do to licensing reasons (which no one has been able to quite figure out :confused: ). And Pages uses gzip within it's file format.

I have two systems here, running 10.2.8 and 10.2.6 respectively, which do not have the developer tools installed and have those compression utilities.

:rolleyes:

What type of program are you making?
 
Well it's for my app Pod2Go. I use tar and gzip (I think) to decompress files from the internet. What line I use is:
Code:
tar -xzf myfile.tar.gz
Shouldn't that work on all systems, 10.2.7 and up?
 
Well, what do you know, you are right, Racer. In my defense, though, the Developer Tools also installs a version of tar - not sure if it's the same version that's installed with the Base System or a newer one.

However, gzip is part of the BSD install, not the base install - and some people decide to skip up on that.

It looks like libz is installed with the Essential.pkg, though, which is all (I think) any app needs to be able to read/write gzip formats. So I think decompressing gzipped tar files would work with a bare install.
 
I have just unpacked my MacMini, tar (GNU tar 1.13.25) and gzip (1.2.4) are installed from the factory.
I did no installation of my own, it came right out of the box, just upgraded to 10.3.8 via software update.
 
Back
Top