# Unix Tar - built-in?



## kainjow (Feb 14, 2005)

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?


----------



## Darkshadow (Feb 14, 2005)

Looks like it's installed with the Developer Tools.


----------



## kainjow (Feb 14, 2005)

Hm so what unix compression utilities are built-in? zip?


----------



## g/re/p (Feb 14, 2005)

type *man gzip* in terminal.....


----------



## g/re/p (Feb 14, 2005)

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


----------



## Darkshadow (Feb 14, 2005)

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.


----------



## brianleahy (Feb 14, 2005)

In 10.3.x   Finder has the "Create Archive" capability built in - and it produces .zip's


----------



## RacerX (Feb 14, 2005)

_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.


----------



## kainjow (Feb 14, 2005)

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.


----------



## RacerX (Feb 14, 2005)

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  ). 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.



What type of program are you making?


----------



## kainjow (Feb 14, 2005)

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:

```
tar -xzf myfile.tar.gz
```
Shouldn't that work on all systems, 10.2.7 and up?


----------



## Darkshadow (Feb 14, 2005)

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.


----------



## gumse (Feb 16, 2005)

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.


----------



## Darkshadow (Feb 16, 2005)

Look at /Library/Receipts, and see if you have a package there named BSD.pkg.


----------



## gumse (Feb 16, 2005)

On my new MacMini BSD.pkg is pre-installed from the factory.


----------



## Darkshadow (Feb 16, 2005)

Just curious.


----------

