LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-19-2005, 01:26 PM   #1
fireemblem555
LQ Newbie
 
Registered: Oct 2005
Posts: 13

Rep: Reputation: 0
Linux Unix Compatibility


Can Unix run Linux files, or vice versa? Any help on this topic would be infinitely appreciated.
 
Old 11-19-2005, 01:50 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,835
Blog Entries: 14

Rep: Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092
Depends on what you mean by "files". Interpreted items such as shell or perl scripts will likely run but may take some tweaking for minor differences. Not all Linux options to commands are available to Unix and vice versa and there may be simple differences in output such as where the command shows up in "ls -l" - might be column 53 on one and column 55 on another so "cut -c 53- " would give odd results).
Also if you have something "#!/bin/bash" as your interpreter line in a Linux shell script you'd likely have to replace it with "!/bin/ksh" on Unix as bash is not the default shell for Unix and usually isn't even installed unless someone added it after the fact - not part of the distributions usually.

Binaries almost certainly won't for two reasons:
1) binaries are processor type specific - something designed for a RISC chip won't run on an x86 (PC) chip. (Doing "file <filename>" would tell you its a data file rather than an executable.)

2) Even when processor type is the same there are apt to be differences in libraries called by the binaries (possibly even the library name itself). If "file <filename>" reports it as an executable you might be able to try running it but if it makes call to external libraries as most things do nowadays its very likely to fail.
 
Old 11-19-2005, 01:51 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Depends on which Unix on which platform and which Linux on
which platform you are talking about ... generally it's safe to assume
that things that can be compiled on Unix can be compiled on Linux
and vice versa (potential library dependencies granted). For binaries
it's not necessarily true (e.g. an executable from Intel/Linux WON'T
run on PPC/AIX).


Cheers,
Tink

Last edited by Tinkster; 11-19-2005 at 01:52 PM.
 
Old 11-19-2005, 01:53 PM   #4
fireemblem555
LQ Newbie
 
Registered: Oct 2005
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks, so does that mean that a linux program that runs for debian on x86, will not run on debian ppc?
 
Old 11-19-2005, 01:59 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
That's correct, too. Again, you will most likely have it there
already, and if you don't you'll be able to apt-get it. But if
you copy ls from a Deb/PPC to a Deb/x86 box it won't do
anything.


Cheers,
Tink
 
Old 11-19-2005, 02:02 PM   #6
fireemblem555
LQ Newbie
 
Registered: Oct 2005
Posts: 13

Original Poster
Rep: Reputation: 0
So Linux running on the same type of processor as Unix will be able to use it's binary files too?
 
Old 11-19-2005, 02:03 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Possibly but not necessarily.
 
Old 11-19-2005, 02:07 PM   #8
fireemblem555
LQ Newbie
 
Registered: Oct 2005
Posts: 13

Original Poster
Rep: Reputation: 0
This is a bit of a stretch but here it goes. So If I downloaded an open source os like darwin that claims to run unix and mac os x files. What are the chances that ppc linux files will run on this?
 
Old 11-19-2005, 04:43 PM   #9
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,835
Blog Entries: 14

Rep: Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092
Not familiar with darwin (OSes don't evolve - they're intelligently designed )

Seriously though a claim to "run Unix and Mac OS X" seems a little broad for the reasons I mentioned before. There are many variants of Unix (its been around since 1969) that run on a plethora of hardware (x86, Sun SPARC, IBM RS6000, HP PA-RISC, Motorola, PowerPC, DEC Alpha are just a few I've encountered) and as noted even on a single platform like x86 you can have BSD, Solaris, SCO, Linux (in most of its distros), AT&T SVR4, Qnix, Xenix and God knows what all.

Early on before the advent of shared libraries I did have some success in running AT&T compiled binaries for x86 SVR4 under SCO 3.2-4.2 on x86 but only because it was a self contained binary so it was processor specific and OK (of course even there you'd could see unexpected results due to things like expected field placement as I mentioned for scripts). However nowadays almost everything relies on shared libraries.

So unless darwin is running "virtual servers" on top of your "physical" chip its unlikely to run everything. Its hard for me to believe there's a product that runs every conceivable Unix "virtual server" though I could see where one might run one. Note that if they are saying they run Mac OS X which supposedly is running a Unix kernel (I've heard arguments that it doesn't actually) it may be they're loosely using the terms Mac OS X and Unix interchangebly.

Last edited by MensaWater; 11-19-2005 at 04:45 PM.
 
Old 11-19-2005, 04:48 PM   #10
fireemblem555
LQ Newbie
 
Registered: Oct 2005
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks for all this information. Just for all ur guy's info Darwin is the open source mac os x kernal that is also partially based on unix. The fact that darwin is based partially on unix is what confused me.
 
Old 11-19-2005, 05:37 PM   #11
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
The OS you're running is less relevant than the architechture that you're running it on. Binaries are compiled to run on a specific processor and they are not interchangable. Any x86 stuff won't run on PPC, regardless of whether you're using linux, AIX or Darwin.
 
Old 11-19-2005, 05:41 PM   #12
fireemblem555
LQ Newbie
 
Registered: Oct 2005
Posts: 13

Original Poster
Rep: Reputation: 0
I fully understand about the processors. The only questions I have are about operating system compatibility.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Help. Linux compatibility... sturla Linux - Hardware 2 04-23-2005 05:50 AM
Unix Book for Beginners (Not Linux... Unix) suse2166 General 6 11-25-2004 11:46 AM
Linux Compatibility? jckings Linux - Hardware 1 06-03-2004 03:35 AM
UNIX (Linux, BSD, etc) Programming :: UNIX kuphryn Programming 8 04-04-2004 11:50 PM
Linux compatibility Susan Linux - Newbie 1 09-29-2001 11:52 AM


All times are GMT -5. The time now is 05:41 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration