views:

251

answers:

5

Where is the code for the terminal command 'tee' located in Mac OS?

[Added] Is it possible to read the exact code, that my mac is using (not the online codes)?

+3  A: 

It's BSD, not Linux, code.

http://www.pell.portland.or.us/~orc/Code/bsd/bsd-current/tee/tee.c

Mike Douglas
A: 

http://www.ss64.com/osx/

John Boker
A: 

Here is the source code of Apple's unix:
http://developer.apple.com/Darwin/

If it is up-to-date this is the exact code that your mac uses.

Georg
+2  A: 

By "code", I guess you mean source code, right? See there

EDIT: I see the question has been made more precise.

See exactly in the "plain" BSD code here as a Apple Developer login (free) is required to browse their code.

Keltia
A: 

Do you mean, where is the executable? If that's what you're asking, it's at /usr/bin/tee. You can locate any command in your path by using the which utility. It will print out the full path to the command. For example:

$ which tee
/usr/bin/tee
$

If you're asking about the actual source code, a number of answers are already here that provide you with links to Apple's source code. The utilities themselves are split amongst a number of packages and there's no real index, so you'll have to browse the names and check packages that sound like they might contain the source for any given utility.

Jason Coco