Opening a Unix File with Mac OS X

Hi. I'm new to Unix and recently received Unix files via email. I downloaded those files but am unable to open them on my computer which uses Mac OS X. How do I open the files?

Hi.

OS X is Unix.

By "open" you mean you double-clicked in Finder and it said "There is no application set to open the document"?

What kind of file is it?

Hi Scott,
Thanks for responding quickly. Under 'Kind of file' I see Unix E....le file. Does this make sense to you?

UNIX executable perhaps?

You can't run non-OSX programs on OSX, except maybe shell scripts.

Instead of using "Get Info", try opening a terminal and using the "file" command. That should show the exact file type.

Hello Corona688. Thanks for clearing/providing a suggestion for Unix E...file. Is this a file then that I should be able to open on my computer?

As already stated, you can't run programs from another UNIX on OSX.

If it's not supposed to be a program, do what Scott has already suggested for more information on what it actually is.

There's a nice little OS X program called Go2Shell which adds an icon to your Finder toolbar. Whenever you click it, it opens a terminal in whatever folder Finder is looking at.

As you are new to Unix (and presumably OS X), I thought that might be useful :slight_smile: (saves you manually navigating if you want to run "file" on the, err, file)

Thanks, Scott. I'll check the Go2Shell. And yes, I am very new to this so thank you also for your patience.

OS X will run any standard UNIX program, at the command-line, or in the X Windowing environment. "UNIX Executable file" means that OS X does not know in particular what kind of file it is looking at, but if it is a binary file it can be executed. If it is a text file, it can be opened with vi or nano, or any GUI text editor, such as TextEdit, or TextWrangler.

I think you've bought into the hyperbole a little too much.

Hypothetically speaking, any POSIX-compliant program can be ported to OSX. It has POSIX features available, and also things like X11. That doesn't mean you can just blindly copy a binary executable over from a Z9 machine and expect it to work. You have to compile it for OSX -- build it from scratch -- because there's no such thing as a "UNIX machine". UNIX is a paper standard, OSX and Solaris and BSD and AIX and others are actual operating systems built to this standard, and their executables and architectures aren't really interchangable.

Shell scripts may work between these systems with relatively minor changes.

Correction -- Yes, OS X is source compatible, but not binary compatible, with other systems that are designed to the Single UNIX Specification. So, as long as you have access to the source for a given UNIX program, and it is not tailored to a specific variant, the program should compile on OS X.

---------- Post updated at 10:33 PM ---------- Previous update was at 07:16 PM ----------

Pardon me for the late help. But if you know that the files that you received by e-mail are text documents, then you can open them with any of the GUI tools that are available on OS X, such as TextEdit or TextWrangler.

If the files are UNIX programs (executable files), then you can put them into /usr/local/bin, or one of the folders that store UNIX binaries, so that you can type the file name into Terminal and have it run automatically. So, the first thing to do is to find out what kind of files you received, and then you will be able to find out what to do with them.

I replied earlier, but I think my message got trashed! OS X is a compliant UNIX system, and can run any standard UNIX programs. However, binaries are very specific to the kind of hardware/operating system that you are running. To get UNIX software to run properly on OS X, you need to download the source code for the program, and compile/build it on your system, so that the proper binary files can be created. You compile UNIX source code with XCode, it is a free development tool that you can download from the Mac App Store. Open the App Store on your computer, and type "XCode" in the Search box. You will see a blue icon with a hammer, click on that icon and you will be able tr download XCode. It is a fairly large application, so it may take some time to download.

I hope this helps!

--Daniel