LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   purest UNIX operating system? (http://www.linuxquestions.org/questions/linux-general-1/purest-unix-operating-system-734526/)

tigertim71 06-21-2009 05:57 AM

purest UNIX operating system?
 
I've been trying to understand some things to do with the UNIX, Linux relationship. My guess is that UNIX or C is the terminal system language of Linux, but how does this vary from distro to distro?

I've noticed that the syntax in some books varies slightly, some using # or ~ for root/superuser access access and $ for ordinary. Is there a good on line source for this?

Also, what is the purest UNIX o/s; FreeBSD, Solaris and in terms of learning terminal commands, would there be any difference between these and Ubuntu?

noctilucent 06-21-2009 06:37 AM

You should read:

http://en.wikipedia.org/wiki/C_(programming_language)
http://en.wikipedia.org/wiki/Unix
http://en.wikipedia.org/wiki/Unix-like
http://en.wikipedia.org/wiki/BSD
http://en.wikipedia.org/wiki/Linux
http://en.wikipedia.org/wiki/Solaris_(operating_system)
http://en.wikipedia.org/wiki/Ubuntu
http://en.wikipedia.org/wiki/Shell_(computing)
http://en.wikipedia.org/wiki/Bourne-Again_shell
http://www.gnu.org/software/bash/manual/

sycamorex 06-21-2009 06:45 AM

Quote:

some using # or ~ for root/superuser access access and $ for ordinary
AFAIK, ~ refers to the home directory of a currently logged in user (regardless of the fact whether it's root or an ordinary user):
Logged in as root ~ refers to /root directory. Similarly, if you are logged in as eg. john, ~ will point to /home/john.

tronayne 06-21-2009 07:28 AM

OK, let's take a shot at this: when you say UNIX, you're really talking about AT&T UNIX System V Release 4 (SVR4). Written almost entirely in C (there used to be a couple of assembly language pieces but those have pretty much gone the way of the dinosaurs), same with Linux -- the kernel is, pretty much, written in C (there may be some C++ stuff in there, I dunno, haven't looked lately, but essentially, the kernel in both SVR4 and Linux is C). Sun Microsystems Solaris operating system is SVR4 (as is, I believe, Apple's OS X and a few other offerings out there). For all practical purposes, it's difficult to tell the differences unless you dig deeply into the guts of the things.

Where you really see differences, though, is the utilities; the stuff you use all the time. GNU utilities (which almost all of them are in a Linux distribution) are not the same as AT&T versions -- GNU is an acronym for Gnu's Not Unix (and there's a whole philosophy surrounding that). The AT&T versions tend to be built around M. Douglas McIlroy's Unix Philosophy (roughly, a program or function should do one thing and do it well) where the GNU versions tend to add functionality (which some folks call "bloat"); human beings seem to be unable to leave well enough alone, methinks.

The pound sign, dollar sign thing (the terminal prompt) just goes back to the good old days when you worked on a Teletype and the command prompt let you know that you were working as the super-user (the pound sign) or as a non-privileged user (the dollar sign). The tilde is a shorthand for your home directory. UNIX was developed at Bell Laboratories on Teletypes; the reason many utility names are only two or so characters? It takes about ten pounds of pressure to type on a Teletype (and they're pretty much blaze along at about 30 characters per second on a good day). If you don't like the pound sign, dollar sign, you can assigned anything else you want to the environment variables PS1 and PS2; e.g., here's a section from /etc/profile that does that
Code:

# Set a default shell prompt:
#PS1='`hostname`:`pwd`# '
if [ "$SHELL" = "/bin/pdksh" ]; then
 PS1='! $ '
elif [ "$SHELL" = "/bin/ksh" ]; then
 PS1='${HOST}-${USER}-${PWD}: '
elif [ "$SHELL" = "/bin/zsh" ]; then
 PS1='%n@%m:%~%# '
elif [ "$SHELL" = "/bin/ash" ]; then
 PS1='$ '
else
 PS1='\u@\h:\w\$ '
fi
PS2='> '
export PATH DISPLAY LESS TERM PS1 PS2

I use Korn Shell, so my command line prompts are the "ksh" ones, PS1='${HOST}-${USER}-${PWD}: ', your mileage may vary.

So, what's "pure?" Well, nuthin, to be truthful; everybody adds something. BSD split off from AT&T's version (at about UNIX System 3, for lack of a better term), the Free Software Foundation (that's GNU) began building look-work alike utilities about then (we're talking early-to-mid 1980's here), a kid in Finland like what he saw in UNIX and sat down to write a look-work alike (and we all know how that turned out), SCO bought UNIX from AT&T (and that doesn't seem to be working too well), and the lowest common denominator (anything made by Microsoft) dominates, sigh. About as close as you're going to get is Solaris; in the Linux world, Slackware is the most un-fooled-around-with Linux distribution (I bounce back and forth between Solaris and Slackware and it's hard to tell the difference most of the time). Ubuntu? Well, Ubuntu does a lot of things for you and some folks find that annoying; for here can be interpreted as to; my personal opinion (for whatever that's worth) is that Ubuntu is excellent for folks migrating from Microsoft to a real operating system, nothing wrong with it, kinda nice, but...

It all gets down to you and what you want; Linux gives you the opportunity to try a distribution and if you don't like it for whatever reason, go try another distribution. Once you're comfortable with the utility set and can get around and do things, you'll start to notice the subtle differences from one to the next and you'll settle on something you're comfortable with.

If you're interested in pursuing this, you can look at and download source code for various versions of UNIX from links at The UNIX Heritage Society (http://www.tuhs.org) and The Heirloom Project (http://heirloom.sourceforge.net/index.html), where you can download almost all the standard SVR4 utilities and build them on your Linux system; kinda cool, that one.

Hope this helps some.

johnsfine 06-21-2009 07:54 AM

Quote:

Originally Posted by tronayne (Post 3581254)
It takes about ten pounds of pressure to type on a Teletype (and they're pretty much blaze along at about 30 characters per second on a good day).

That good day must have been long after Unix was invented. When Unix was invented Teletypes were strictly 10 CPS.

30 CPS devices that were otherwise almost compatible with Teletypes were invented years later.

Teletypes had 7 bit characters in 11 bit frames at 110 bits per second. Those later devices had 7 or 8 (depending on model) bit characters in 10 bit frames at 300 bits per second.

I'm not sure what you mean by ten pounds of pressure. The pressure at which you needed to press the keys of a Teletype was more than required on an electric typewriter, but far less than needed on a mechanical typewriter and certainly not ten pounds. Any 30 CPS model I ever saw had exactly the keyboard characteristics (pressure, tactile feedback, etc.) of a standard electric typewriter, which means too little key pressure rather than too much. As keyboard ergonomics improved, the keyswitch pressure on a good quality keyboard has become slightly higher than on an electric typewriter from the 60's or 70's, not lower.

dxqcanada 06-21-2009 08:56 AM

AT&T Unix was sold to Novell (and who still own the rights ... which SCO found out the hard way).
Prior to that AT&T and SUN did some worked together.
BSD was spun off from AT&T Unix very early on.

The "terminal system" is governed by the shell (command interpreter) that is running.

Korn (ksh), Bourne (sh), Bourne again (bash), C shell (csh) ... etc.

tronayne 06-21-2009 09:01 AM

Oh, duh! A slip of the synapses, I suppose -- yeah, 110 baud, 10 CPS, slower than the average typist, oiled paper tapes (kind of nice for "long-term storage" and "program loading"). The ASR 33's that I used caused a whole lot of fatigue after a few hours of whacking away at the keyboard and... ten pounds? Well, sure seemed like it at the time (especially compared to an IBM electric typewriter or a Royal manual). Moving on up to an Anderson-Jacobsen with those daisy-wheel heads, forms tractor and, holy toot, 1200 baud... ah, heaven.

Still miss those things.

tigertim71 06-21-2009 10:35 AM

purest UNIX operating system?
 
Wow, what responses. To think that this time last year, I thought Microsoft was the best operating system in the world. Now, I'll choke if anyone mentions them...

Having migrated from XP to Ubuntu, which is a really good system for beginners (probably the best for this), as well as having tried Puppy which is great for low RAM pc's, it is now time to look for something different.

I'm definitely going to take into account these postings and try out some new o/s' and no doubt will be back again on the forum. It's ashame Microsoft wasn't beaten in the personal pc market by Linux/UNIX. We would have all been spared wasted life moments and general irritation...

sycamorex 06-21-2009 04:54 PM

Why do you ask about unix anyway? I don't remember the whole history of unix/linux, but as far as I know, you'll be better off having any linux distro on your desktop. Correct me if I'm wrong, but if someone is interested in unix now (we're talking about private desktops), it must be only for historical purposes. As I said, I might be far from the truth, but that's my impression (having used linux for the last 4 years)

tigertim71 06-22-2009 05:19 PM

purest UNIX operating system
 
I was just really interested in the Linux/Unix connection and have noticed that Solaris and BSD don't seem to categorise themselves as Linux, rather more as UNIX.

chrism01 06-22-2009 07:26 PM

Well, here's a graph/map of Linux derivatives: http://www.kde-files.org/CONTENT/con...218-gldt76.png
There's a load of history, inc derivative graphs for Unix here: http://www.levenez.com/unix/

i92guboj 06-23-2009 10:05 AM

Quote:

Originally Posted by tigertim71 (Post 3581188)
I've been trying to understand some things to do with the UNIX, Linux relationship. My guess is that UNIX or C is the terminal system language of Linux, but how does this vary from distro to distro?

I've noticed that the syntax in some books varies slightly, some using # or ~ for root/superuser access access and $ for ordinary. Is there a good on line source for this?

Also, what is the purest UNIX o/s; FreeBSD, Solaris and in terms of learning terminal commands, would there be any difference between these and Ubuntu?

What you call the terminal system language is determined by the shell you use. On most linux distros that's bash, but there are others like ksh, csh (and many derivatives), zsh and some others. These has nothing to do with C (other than the fact that some -all?- of them are programmed in C themselves). The only one whose syntax resembles in some way to C is csh. But it isn't -by any means- compatible at syntactical level with C. It wouldn't make much sense for a command interpreter anyway.

As for the symbols used for the prompt, that's merely a graphical thing that can be changed at your desire. It's the convention to use # for root adn $ for regular user (~ is used to mean $HOME, the home dir). But it can really be set to any other thing you like.

There are a number of OSes which are derived conceptually from the original AT&T unix, however, Linux Is No UniX. It's just a free kernel that someone built to act in a similar way to this of UNIX, including POSIX complicance and a similar paradigm that built strongly based around the concept of files and the file system.

There are a number of commercial UNIXes, and lots of different OSes that resemble UNIX to a bigger or lesser degree. I'd say that between the free ones, Solaris is the closest you can get. BSD's are near enough, and Linux is different enough. There are many more.

Ubuntu is just a distribution of Linux, which has a Linux kernel and a lot of -mostly GNU licensed- tools that together build an OS. There are many more of these as well.

As for the differences between the tools, well, most UNIXes use either the original posix tools or at least tools of their own that are compatible with the original posix ones.

Most GNU tools -which are what linux uses instead- are a superset of the functionality of the original equivalent posix tool, but in any case they retain the posix compatibility as a subset because that's what any long-lived script will expect. That's done that way to retain portability between different unix clones. And of course, that also eases the life of the regular user when dealing with the command line. It's just easy to work when the tools always work like you expect them to.

When reading a man page in linux you will often find comments about the original posix functionality and behavior, about parameters that are even retained with no real functionality just for the sake of compatibility, and about GNU extensions which might not work on other UNIXes that use the posix toolset.

Quote:

Originally Posted by sycamorex (Post 3581687)
Why do you ask about unix anyway? I don't remember the whole history of unix/linux, but as far as I know, you'll be better off having any linux distro on your desktop. Correct me if I'm wrong, but if someone is interested in unix now (we're talking about private desktops), it must be only for historical purposes. As I said, I might be far from the truth, but that's my impression (having used linux for the last 4 years)

There are many unixes that can be used as personal desktops, but I usually just advice to go linux for that. Even today, the hardware support (overall the the newest technologies) is far better and comes much sooner into the linux kernel.

In which regards regular programs, most of the userland software is ported soon enough, a big part of it is developed with both OSes in mind and might even be released at the same time for both. Still some thing might lag behind.

Quote:

Originally Posted by tigertim71 (Post 3582766)
I was just really interested in the Linux/Unix connection and have noticed that Solaris and BSD don't seem to categorise themselves as Linux, rather more as UNIX.

Well, the pre-requisite to qualify to be a linux distro is to use a linux kernel. BSD's do have their own kernel, which are built from the ground and have absolutely nothing to do with the linux kernel.

I just see them all as a galore of clones of the original UNIX, linux relates less closely, BSD's relates more directly, and Solaris and some other commercial unixes relates even more closely.

However, I am admittedly no expert in either solaris, bsd's nor any other unix clone. I've only used them in the university as a user, and not as an administrator. So someone might have a different opinion about that.

In any case, as said, bsd's have absolutely nothing to do with linux, at all.

tigertim71 06-23-2009 12:13 PM

purest UNIX operating system
 
Thanks to all for this.

i92guboj - I'm beginning to get a better understanding of this from your post.

The whole history of this is quite interesting really and at least as users, we are now spoilt for choice on free software, and can try out and assess the various operating systems on virtual programs before installing.

i92guboj 06-23-2009 01:23 PM

Yep. That's true.

The thing about linux (which is maybe why it's more famous and extended than others) is that it's a very generalist OS. It can do lots of things very well and lots of things acceptably, while supporting the majority of the hardware available to one or another degree. This is what desktop users expect from a modern OS.

Other UNIX clones are maybe less generalist, but can do some things better (or at least, some people think so). BSDs are commonly named because of their security and stability. But even amongst BSDs you can find very different models. OpenBSD for example is centered about these principles of stability and security. Others like FreeBSD are more generalist, while still offering many of the advantages of BSDs in general. NetBSD instead has the advantage that it runs on a wide range of architectures, from huger server machines to some embedded devices. Linux can do all of this without a problem, whether it's good enough or not, better or worse or whatever else... that's open to discussion as always.

DotHQ 06-23-2009 02:11 PM

Quote:

Originally Posted by tigertim71 (Post 3582766)
I was just really interested in the Linux/Unix connection and have noticed that Solaris and BSD don't seem to categorise themselves as Linux, rather more as UNIX.

Solaris is UNIX
BSD is UNIX
Linux is UNIX

As was mentioned the purest /1st was AT&T. BSD came along shortly thereafter.

Any of these OS's will carry with them the core UNIX command set. So you can learn the basics from any of them. I can see where it would be hard to know that rpm's were not a original part of UNIX but awk was. To me RPM's came along to make things easier to install and update software with the proper versions so that things worked together. Nowdays things are so interdependent that things like dependencies have to be taken into consideration much more than 30 years ago.

Before Linux I worked on AT&T, HPUX, SUN-OS, Solaris and AIX. If you can work on one you can work on any of them. They all have their home grown goodies but the core commands are the same. Most of these core commands exist on all flavors of Linux. IMHO Solaris is no more pure than HPUX or AIX or Red Hat Linux / CentOS etc. Pick one. I really don't think you can go wrong. The better you get to know any one flavor it will make it that much easier to learn any UNIX derivative.

ps. I saw some AIX servers for 60 bucks on Ebay that came with the AIX OS. Cheap way to learn UNIX with a little of IBM's tidbits tossed in. (AIX is IBM's UNIX flavor).


All times are GMT -5. The time now is 12:09 PM.