See what "UNIX" is in other dictionaries. UNIX Operating System Overview

Two terms Linux and UnixThey are very similar to each other and are often confused even by experienced users. Let's still clarify the difference between these concepts and in what cases they should be used. Let's start with the history of Linux and Unix.

History of Uni x began in the late 1960s, the system was initially developed together with MIT and General Electric, but then some developers decided to make their own OS and in 1970 it was called Unix, then it was rewritten in the C programming language. Since that time, the OS began to be distributed both free and commercially. New editions and variants appeared, BSD being the most popular.

Linux is similar in functionality to Unix, but the code base is quite different. This operating system was made from two projects, one of which is GNU, and the second is the Linux kernel. The goal of such a project is to create a system similar to Unix itself, but which would not depend on it. In other words, it was necessary to create an OS that would be freely distributed and could be modified without restrictions. Linux was inspired by Minix, a successor to Unix, but the code base was written from scratch. Linux was designed for use on ordinary PCs, while Unix was used by large firms. But today Linux works great on most platforms and integrates with many tools. For example, modern Linux distributions work smoothly even with Windows file systems - FAT32, NTFS. How did the Linux symbol appear?

What is the essence of Unix?

This term can refer to several concepts at once:

  • a unique OS on the basis of which other operating systems are created and developed;
  • a trademark owned by The Open Group. This company develops standards for operating systems Single UNIX Specification. Systems that conform to these standards can legally be called Unix;
  • all operating systems that are registered under the Unix name: AIX, A/UX, HP-UX, Inspur K-UX, Reliant UNIX, Solaris, IRIX, Tru64, UnixWare, z/OS and OS X.

What is the essence of Linux?

  • it is a Unix-like operating system that behaves like Unix but does not use its code;
  • does not have a Unix certificate, but has many similarities in functionality;
  • implements many principles of Unix operation.

How are Linux and Unix similar?

Both systems have similar data administration principles, in addition, the basic OS management commands are identical. The systems are also resistant to viruses at the same level.

Main differences between Linux and Unix?

Linux is an open source OS, distributed free of charge, Unix - only its derivatives are freely available. Linux can be called a kind of Unix clone that does not use its code. Linux was originally developed for home PCs, and Unix for large corporations. True, today Linux supports more platforms than Unix and is more popular among users. And, of course, Linux supports more types of file systems than Unix. Operating systems based on LINUX. ?

Often these concepts are confused due to the fact that they can be interpreted differently and mean different things.If we take all factors into account, the Unix OS is less universal, because each distribution is adapted to only a certain number of platforms and file systems, unlike Linux, which is much more universal in this regard.

The differences between Linux and UNIX are significant. UNIX is a broad concept, more specifically, a certain foundation for the construction and certification of all UNIX-like systems, and Linux is one of the UNIX-like branches. Although, if we take into account the technology factor, these terms are quite close. For example, a lot of software that was created for Linux can be perfectly adapted to work with the UNIX operating system. There is no need to rewrite the source code. Useful commands Linux you need to know next.

As a result of this article, the following sequence can be given:UNIX → UNIX-like OS → Linux, which largely explains the consistency and dependency of both operating systems.

Main differences between Linux and BSD.

Hyper Host™ wishes you success and productive work with Linux and UNIX!

9171 times 7 Viewed times today

Introduction

What is Unix?

Where can I get free Unix?

What are the main differences between Unix and other OSes?

Why Unix?

Unix Concepts

File system

Command interpreter

Manuals - man

Introduction

Writing about the Unix OS is extremely difficult. Firstly, because a lot has been written about this system. Secondly, because Unix ideas and solutions have had and are having a huge impact on the development of all modern operating systems, and many of these ideas are already described in this book. Thirdly, because Unix is ​​not one OS, but a whole family of systems, and it is not always possible to “trace” their relationship with each other, and it is simply impossible to describe all the OSes included in this family. Nevertheless, without in any way claiming to be complete, we will try to give a quick overview of the “Unix world” in those areas that seem interesting to us for the purposes of our training course.

The birth of the Unix OS dates back to the late 60s, and this story has already become overgrown with “legends” that sometimes tell different stories about the details of this event. The Unix OS was born at the Bell Telephone Laboratories (Bell Labs) research center, part of AT&T Corporation. Initially, this initiative project for the PDP-7 computer (later for the PDP-11) was either a file system or computer game, or a text preparation system, or both. It is important, however, that from the very beginning the project, which eventually turned into an OS, was conceived as a software environment for collective use. The author of the first version of Unix was Ken Thompson, but a large team of employees (D. Ritchie, B. Kernighan, R. Pike and others) took part in the discussion of the project, and subsequently in its implementation. In our opinion, several fortunate circumstances in the birth of Unix determined the success of this system for many years to come.

For most of the employees of the team in which the Unix OS was born, this OS was the “third system”. There is an opinion (see, for example) that a systems programmer achieves high qualifications only when completing his third project: the first project is still a “student’s” project, in the second the developer tries to include everything that did not work out in the first, and in the end it turns out to be too cumbersome , and only in the third is the necessary balance of desires and possibilities achieved. It is known that before the birth of Unix, the Bell Labs team participated (together with a number of other companies) in the development of the MULTICS OS. The final product, MULTICS (Bell Labs was not involved in the final stages of development), bears all the hallmarks of a "second system" and is not widely used. It should be noted, however, that many fundamentally important ideas and solutions were born from this project, and some concepts that many consider to be born in Unix actually have their origin in the MULTICS project.

The Unix OS was a system that was made "for yourself and for your friends." Unix was not tasked with capturing the market and competing with any products. The developers of the Unix OS themselves were also its users, and they themselves assessed the suitability of the system to their needs. Without the pressure of market conditions, such an assessment could be extremely objective.

The Unix OS was a system made by programmers and for programmers. This determined the elegance and conceptual harmony of the system, on the one hand, and on the other, the need for an understanding of the system for the Unix user and a sense of professional responsibility for the programmer developing software for Unix. And no subsequent attempts to make “Unix for dummies” could rid the Unix OS of this advantage.

In 1972-73 Ken Thompson and Dennis Ritchie wrote new version Unix. Especially for this purpose, D. Ritchie created the C programming language, which is no longer necessary to introduce. More than 90% program code Unix is ​​written in this language, and the language has become an integral part of the OS. The fact that the main part of the OS is written in the language high level, provides the ability to recompile it into codes of any hardware platform and is the circumstance that determined the widespread use of Unix.

During the creation of Unix, US antitrust laws prevented AT&T from entering the market software products. Therefore, the Unix OS was non-commercial and freely distributed, primarily in universities. There its development continued, and it was most actively carried out at the University of California at Berkeley. At this university, the Berkeley Software Distribution group was created, which was engaged in the development of a separate branch of the OS - BSD Unix. Throughout subsequent history, the main branch of Unix and BSD Unix developed in parallel, repeatedly enriching each other.

As the Unix OS spread, the interest in it from commercial firms began to grow, and they began to release their own commercial versions of this OS. Over time, AT&T's "mainstream" branch of Unix became commercial, and a subsidiary, Unix System Laboratory, was created to promote it. The BSD branch of Unix in turn branched into commercial BSD and Free BSD. Various commercial and freely available Unix-like systems were built on the AT&T Unix kernel, but they also included features borrowed from BSD Unix, as well as original features. Despite the common origin, differences between members of the Unix family accumulated and eventually led to the fact that porting applications from one Unix-like OS to another became extremely difficult. At the initiative of Unix users, a movement arose to standardize the Unix API. This movement was supported by the International Organization of Standards ISO and led to the emergence of the POSIX (Portable Operation System Interface eXecution) standard, which is still being developed and is the most authoritative standard for the OS. However, establishing the POSIX specification as an official standard is a slow process and cannot meet the needs of software manufacturers, which has led to the emergence of alternative industry standards.

With the transition of AT&T Unix to Nowell, the name of this operating system changed to Unixware, and the rights to the Unix trademark were transferred to the X/Open consortium. This consortium (now the Open Group) developed its own (broader than POSIX) system specifications, known as the Single Unix Specification. The second edition of this standard was recently released, much better aligned with POSIX.

Finally, a number of companies producing their own versions of Unix formed the Open Software Foundation (OSF) consortium, which released its own version of Unix - OSF/1, based on the Mach microkernel. OSF also released the OSF/1 system specifications, which led OSF member firms to produce their own Unix systems. Among such systems: SunOS from Sun Microsystems, AIX from IBM, HP/UX from Hewlett-Packard, DIGITAL UNIX from Compaq and others.

At first, the Unix systems of these companies were largely based on BSD Unix, but now most modern industrial Unix systems are built using (under license) the AT&T Unix System V Release 4 (S5R4) kernel, although they also inherit some properties of BSD Unix. We do not take responsibility for comparing commercial Unix systems, since comparisons of this kind that appear periodically in the press often present completely opposite results.

Nowell sold Unix to Santa Crouse Operations, which produced its own Unix product, SCO Open Server. SCO Open Server was based on an earlier version of the kernel (System V Release 3), but was superbly debugged and highly stable. Santa Crouse Operations integrated its product with AT&T Unix and released Open Unix 8, but then sold Unix to Caldera, which owns the "classic" Unix OS today (late 2001).

Sun Microsystems began its representation in the Unix world with the SunOS system, created on the basis of the BSD kernel. However, it was subsequently replaced by the S5R4-based Solaris system. Currently, version 8 of this OS is distributed (there is also v.9-beta). Solaris runs on the SPARC (RISC processors manufactured to Sun specifications) and Intel-Pentium platforms.

Hewlett-Packard offers HP-UX OS. v.11 on the PA-RISC platform. HP-UX is based on S5R4, but contains many features that indicate its origins in BSD Unix. Of course, HP-UX will also be available on the Intel-Itanium platform.

IBM comes out with the AIX OS, the latest version to date is 5L (we will talk about it later). IBM did not announce the "pedigree" of AIX, it is largely an original development, but the first versions bore signs of origin from FreeBSD Unix. Now, however, AIX is more like S5R4. The AIX OS was initially available on the Intel-Pentium platform, but subsequently (in accordance with IBM's general policy) was no longer supported on this platform. AIX currently runs on IBM RS/6000 servers and other PowerPC-based computing platforms (including IBM supercomputers).

DEC's DIGITAL UNIX OS was the only commercial implementation of the OSF/1 system. DIGITAL UNIX OS ran on DEC Alpha RISC servers. When DEC was acquired by Compaq in 1998, both Alpha and DIGITAL UNIX servers went to Compaq. Compaq intends to restore its presence in the Alpha server market and, in connection with this, is intensively developing the OS for them. The current name of this OS is Tru64 Unix (current version is 5.1A), it continues to be based on the OSF/1 kernel and carries many of the features of BSD Unix.

Although most commercial Unix systems are based on a single kernel and comply with POSIX requirements, each has its own API dialect, and the differences between dialects accumulate. This leads to the fact that the transfer of industrial applications from one Unix system to another is difficult and requires, at a minimum, recompilation, and often adjustments source code. An attempt to overcome the “confusion” and make a single Unix OS for all was made in 1998 by an alliance of SCO, IBM and Sequent. These firms united in the Monterey project with the goal of creating a single OS based on Unixware, which at that time was owned by SCO, IBM AIX and Sequent's DYNIX OS. (The Sequent company occupies a leading position in the production of computers with the NUMA architecture - asymmetric multiprocessor - and DYNIX - this is Unix for such computers). Monterey OS was to run on the 32-bit Intel-Pentium platform, the 64-bit PowerPC platform, and the new 64-bit Intel-Itanium platform. Almost all leaders in the hardware and middleware industry have expressed support for the project. Even companies that have their own Unix clones (except Sun Microsystems) have announced that Intel platforms they will only support Monterey. Work on the project seemed to be going well. Monterey OS was among the first to prove its performance on Intel-Itanium (along with Windows NT and Linux) and the only one that did not emulate the 32-bit Intel-Pentium architecture. However, at the final stage of the project, a fatal event occurred: SCO sold its Unix division. Even earlier, Sequent became part of IBM. The "successor" of all the properties of the Monterey OS was the IBM AIX v.5L OS. However, not quite everyone. The Intel-Pentium platform is not a strategic focus for IBM, and AIX is not available on this platform. And since other leaders in the computer industry did not share (or did not quite share) IBM's position, the idea of ​​a common Unix operating system never came to fruition.

The UNIX operating system is an interactive system used to support multiple processes and multiple users simultaneously. The UNIX operating system has a sufficient number of tools that allow programmers to both collaborate and manage the use of shared information.

UNIX OS is designed for experienced programmers. It is a powerful and flexible system. It is characterized by a small number of basic elements that can be combined in an infinite number of ways to tailor them to a specific application. One of the basic rules of the UNIX system is that each program should do only one thing, but do it well. Useless redundancy has been eliminated from the system. For example, why write sorry, when enough is enough Wed?

The UNIX operating system can be viewed as a pyramid (Fig. 3.6). At the base of the pyramid is the hardware, which consists of the CPU, memory, disks, terminals, and other devices. On hardware running UNIX system. Its function is to manage the hardware and provide system calls to all programs. These system calls allow programs to create and manage processes, files, and other resources.

Rice. 3.6. Levels operating system UNIX

Programs make system calls by placing arguments in CPU registers and executing interrupt commands to switch from user mode to kernel mode and transfer control to the UNIX operating system.

In addition to the OS and system call library, all versions of UNIX contain a large number of standard programs, some of them are described by the POSIX 1003.2 standard, while others may vary between different versions of the system. These programs include the command processor (shell), compilers, editors, word processing programs, and file utilities. It is these programs that are launched by the user from the terminal.

Thus, there are 3 interfaces in the UNIX OS: the system call interface, the library function interface, and the interface formed by a set of standard utility programs. Most users consider the latter interface to be a UNIX system. In reality, it has virtually nothing to do with the system itself and can easily be replaced. In some versions of the system, for example, this keyboard-oriented user interface was replaced by a mouse-oriented graphical interface without requiring any changes to the system itself. It was this flexibility that made UNIX so popular and allowed it to survive numerous changes in the technology underlying it.



Many versions of the UNIX system have GUI user interface, similar to popular interfaces used on Macintosh computers and Windows system. However, many programmers prefer a command line interface called shell . (shell). It is much faster to use, significantly more powerful, easier to expand, and does not irritate the user with the need to constantly grab the mouse. When the shell starts, it initializes and then displays a prompt character (usually a dollar or percent sign) and waits for the user to enter the command line.

The UNIX user interface consists not only of the shell, but also of large number standard utility programs called utilities. These programs can be divided into six categories:

1. Commands for managing files and directories.

2. Filters.

3. Program development tools such as text editors and compilers.

4. Word processors.

5. System administration.

6. Miscellaneous.

The POSIX 1003.2 standard defines the syntax and semantics of fewer than 100 of these programs, mostly in the first three categories. The idea behind standardizing these programs is so that shells can be written that will work on all UNIX systems. In addition to these standard utilities, there are many more application programs such as web browsers, image viewers, etc.

This short review We will conclude the UNIX OS by considering the main concepts supported by the system, namely processes. This information is important because system calls - the interface to the operating system itself - control it. For example, there are system calls for process creation, memory access, file opening, and I/O.

The only active entities on a UNIX system are processes. UNIX processes are very similar to the classical sequential processes that were discussed at the beginning of this chapter. Each process runs one program and initially receives one thread of control. In other words, a process has one program counter, pointing to the next processor instruction to be executed. Most versions of UNIX allow a process to create additional threads after it has started.

UNIX is a multitasking system so that several independent processes can run simultaneously. Each user can have multiple processes active at the same time, so a large system can have hundreds or even thousands of processes running simultaneously. Most single-user workstations run dozens of background processes called demons . They start automatically when the system boots.

The file system in UNIX is hierarchical, with files and directories. All disks are mounted into a single directory tree, starting at the same root. Individual files can be associated with any directory in the tree. To use a file, you must first open it. In this case, the process that opens the file returns descriptor file, which is then used when reading from and writing to the file (each call that creates an object returns a result called a handle to the calling process). Inside file system uses three main tables: file descriptor table, file descriptor table open files and a table of i-nodes. In this case, the table of i-nodes is the most important. It contains information necessary to manage the file and allow its blocks to be found.

UNIX originated at AT&T's Bell Labs more than 20 years ago.

UNIX is a multi-user, multi-tasking OS that includes quite powerful means of protecting programs and files of various users. It is written in the C language and is machine-independent, which ensures its high mobility and easy portability of application programs to PCs of various architectures. An important feature of the UNIX family OS is its modularity and extensive set of service programs, which allow you to create a favorable operating environment for user programmers.

Supports hierarchical file structure, virtual memory, multi-window interface, multiprocessor systems, multi-user database management system, heterogeneous computer networks.

UNIX OS has the following main characteristics:

Portability;

- preemptive multitasking based on processes running in isolated address spaces in virtual memory;

Supports simultaneous work of many users;

Support for asynchronous processes;

Hierarchical file system;

Support for device-independent I/O operations (via special device files);

Standard interface for programs (program channels, IPC) and users (command interpreter, not included in the OS kernel);

Built-in system usage accounting tools.

UNIX OS architecture- multi-level. Works at the lower level core operating system. Kernel functions (process management, memory management, interrupt handling, etc.) are accessible through system call interface, forming the second level. System calls provide a software interface for accessing kernel procedures. At the next level they work command interpreters , commands and utilities for system administration, communication drivers And protocols , - everything that is usually attributed to system software . The outer level is formed application programs user, network and other communication services, DBMS and utilities.

The operating system performs two main tasks: data manipulation and storage. Most programs primarily manipulate data, but ultimately it is stored somewhere. On a UNIX system, this storage location is file system. Moreover, in UNIX all devices, with which the operating system works, are also presented as special files in the file system.

Logical file system in UNIX OS (or simply file system ) is a hierarchically organized structure of all directories and files in the system, starting with root catalogue. The UNIX file system provides a unified interface for accessing data located on various media and to peripheral devices. A logical file system can consist of one or more physical file (sub)systems, which are sections of physical media (disks, CD-ROMs or floppy disks).


The file system controls file permissions, performs file creation and deletion operations, and writes/reads file data. The file system provides redirection of requests addressed to peripheral devices corresponding to the I/O subsystem modules.

The UNIX file system's hierarchical structure makes it easy to navigate. Each directory starting from the root ( / ), in turn, contains files and subdirectories.

In UNIX there are no theoretical restrictions on the number of subdirectories, but there are restrictions on the maximum length of the file name that is specified in commands - 1024 characters.

In UNIX, there are several types of files, differing in functionality:

Regular file - The most common file type that contains data in some format. To the operating system, such files are simply a sequence of bytes. These files include text files, binary data and executable programs.

Catalog- this is a file containing the names of the files contained in it, as well as pointers to Additional information, allowing the operating system to perform actions with these files. Directories are used to form a logical file system tree.

Device special file - Provides access to physical devices. Devices are accessed by opening, reading, and writing to a special device file.

FIFO - named pipe. This file is used for communication between processes on a queue basis.

Socket- allow you to represent a network connection as a file.

Each file in UNIX contains a set of permissions that determine how the user interacts with the file.

Every HDD consists of one or more logical parts - sections. The location and size of the partition is determined when the disk is formatted. In UNIX, partitions act as independent devices that are accessed as different storage media. A section can only contain one physical file system.

There are many types of physical file systems, such as FAT16 and NTFS, with different structures. Moreover, there are many types of UNIX physical file systems ( ufs, s5fs, ext2, vxfs, jfs, ffs etc.).

Brief information about the development of the UNIX OS

UNIX OS appeared in the late 60s as an operating system for the PDP-7 minicomputer. Kenneth Thomson and Dennis Ritchie took an active part in the development.

Features of the UNIX OS include: multi-user mode, new file system architecture, etc.

In 1973, most of the OS kernel was rewritten in the new C language.

Since 1974, the UNIX OS has been distributed in source code at universities in the United States.

UNIX versions

From the very beginning of the spread of UNIX, different versions OS.

To streamline, AT&T in 1982 combined several versions into one and called the OS version System III. A commercial version, System V, was released in 1983. In 1993, AT&T sold its UNIX rights to Novell, which then sold it to the X/Open and Santa Cruz Operation (SCO) consortium.

Another line of UNIX OS, BSD, is being developed at the University of California (Berkeley). There are free versions of FreeBSD and OpenBSD.

The OSF/1 family - Open Software Foundation - includes operating systems from the consortium of IBM, DEC and Hewlett Packard. The operating systems of this family include HP-UX, AIX, Digital UNIX.

Free versions of UNIX operating systems

There is a large number free versions UNIX.

FreeBSD, NetBSD, OpenBSD– options developed on the basis of BSD OS.

The most popular family of free UNIX systems is the family of systems Linux. The first variant of Linux was developed by Linus Torvalds in 1991. Currently, there are several variants Linux: Red Hat, Mandrake, Slackware, SuSE, Debian.

General features of UNIX systems

The different flavors of UNIX share a number of common features:

Time-sharing multiprogramming based on preemptive multitasking;

Support for multi-user mode;

Using virtual memory and swap mechanisms;

Hierarchical file system;

Unification of input/output operations based on the expanded use of the concept of file;

System portability;

Availability network tools interactions.

Advantages of UNIX systems

The advantages of the UNIX family of operating systems include:



Portability;

Effective implementation of multitasking;

Openness;

Availability and strict adherence to standards;

Unified file system;

Powerful command language;

Availability of a significant number of software products;

Implementation of the TCP/IP protocol stack;

Ability to work as a server or workstation.

UNIX-based servers

Server is a computer that processes requests from other computers on the network and provides its own resources for storing, processing and transmitting data. A server running UNIX can perform the following roles:

File server;

Web server;

Mail server;

Server remote registration(authentication);

Auxiliary Web services servers (DNS, DHCP);

Internet access server

Managing a UNIX Computer

When working with a UNIX system in server mode, as a rule, the mode is used remote access using some terminal program.

A work session begins by entering a login name and access password

Often, to solve server management problems, they are limited to the command mode of operation. In this case, for control, special commands are entered into the command line in a special format. The command line has a special prompt, for example:

General view of the command:

  1. -bash-2.05b$ command [options] [options]

For example, calling OS help looks like this:

  1. -bash-2.05b$ man [keys] [topic]
  2. For help on using the man command, type
  3. -bash-2.05b$ man man

Command Line Interpretation

The following conventions are used when entering commands:

First word in command line is the command name;

The remaining words are arguments.

Among the arguments, keys (options) are highlighted - words (symbols) predefined for each command, starting with one (short format) or a pair of hyphens (long format). For example:

Bash-2.05b$ tar –c –f arch.tar *.c

Bash-2.05b$ tar - -create - -file=arch.tar *.c

When specifying options, they can be combined. For example, the following commands are equivalent:

Bash-2.05b$ ls –a –l

Bash-2.05b$ ls –l –a

Bash-2.05b$ ls –al

Other arguments indicate the objects on which the operations are performed.

Shell Variables

When working in the system, there is a way to pass parameters to programs, in addition to using command shell switches, - using environment variables. To set an environment variable, use the set command. Command Format:

Bash-2.05b$ set variable_name=value

Removing an environment variable is done with the unset command.

To access the value of a variable, use the notation $variable_name, for example the command:

Bash-2.05b$ echo $PATH

Prints the value of the PATH variable.