Nix systems. *nix systems commands

Military Technical University at Federal service special construction of the Russian Federation

Institute of Industrial, Civil and Transport Construction

Abstract on the subject of computer science on the topic:

« UNIX-like operating systems"

Moscow 2009-10 .

Introduction

History of education and schism

Overview of BSD-like systems

Overview of file systems of unix-like operating systems

Extended File System

Third Extended File System

Table 1 Size restrictions

Fourth Extended File System

Journaled File System

Peculiarities

Unix File System

Kernel linux-kernel-2.6.xx

Desktop environments

Text editors

Conclusion

Bibliography

Introduction

UNIX- a group of portable, multitasking and multi-user operating systems.

The first UNIX system was developed in 1969 by AT&T's Bell Labs division. Since then, a large number of different UNIX systems have been created. Legally, only a few of them have the full right to be called "UNIX"; the rest, although they use similar concepts and technologies, are united by the term "UNIX-like" (Unix- like). For brevity, in this article, UNIX systems mean both true UNIX and UNIX-like operating systems.

The main distinguishing features of UNIX systems include:

· use of simple text files to configure and manage the system;

· widespread use of utilities launched on the command line;

· interaction with the user through a virtual device - terminal;

· representation of physical and virtual devices and some means of interprocess communication as files;

· use of pipelines from several programs, each of which performs one task.

Currently, UNIX is used primarily on servers and also as embedded systems for various hardware. The leader in the OS market for workstations and home use is Microsoft Windows, UNIX takes only second (Mac OS X) and third (GNU/Linux) places.

UNIX systems are of great historical importance because they gave rise to some of today's popular OS concepts and approaches. software. Also, during the development of Unix systems, the C language was created.

History of education and schism

In 1957, Bell Labs began work on creating an operating system for its own needs. Under the leadership of Victor Vysotsky, the BESYS system was created. He subsequently headed the Multics project and then became head of the information division of Bell Labs.

In 1964, third generation computers appeared, for which BESYS capabilities were no longer suitable. Vysotsky and his colleagues decided not to develop a new operating system of their own, but to join the joint project of General Electric and the Massachusetts Institute of Technology Multics. Telecommunications giant AT&T, which included Bell Labs, provided significant support for the project, but withdrew from the project in 1969 because it was not generating any financial benefits. UNIX was originally developed in the late 1960s by Bell Labs employees, most notably Ken Thompson, Denis Ritchie, and Douglas McIlroy. In 1969, Ken Thompson, seeking to implement the ideas that formed the basis of MULTICS, but on a more modest hardware(DEC PDP-7), wrote the first version of the new operating system, and Brian Kernighan came up with a name for it - UNICS (UNIplexed Information and Computing System) - as opposed to MULTICS (MULTIplexed Information and Computing Service). This name was later shortened to UNIX.

In November 1971, a version was released for the PDP-11, the most successful family of minicomputers of the 1970s (in the USSR, its analogues, produced by the Ministry of Electronic Industry, were known as SM EVM and "Electronics", later DVK, produced in Kyiv, Voronezh, Zelenograd). This version was called the “first edition” (Edition 1) and was the first official version. System time all UNIX implementations date back to January 1, 1970.

The first versions of UNIX were written in assembly language and did not have a built-in compiler with the language high level. Around 1969, Ken Thompson, with the assistance of Denis Ritchie, developed and implemented the B language, which was a simplified version of the BCPL language developed in 1966. Bi, like BCPL, was an interpreted language. In 1972, the second edition of UNIX was released, rewritten in the Bi language. In 1969-1973, a compiled language was developed based on Bi, called C (C).

In 1973, the third edition of UNIX was released, with a built-in C compiler. On October 15 of the same year, the fourth edition appeared, with the system core rewritten in C (in the spirit of the Multics system, also written in the high-level language PL/1), and in 1975 the fifth edition, completely rewritten in C. Since 1974, UNIX has been distributed free of charge to universities and academic institutions. Since 1975, new versions developed outside of Bell Labs began to appear, and the popularity of the system began to grow. Also in 1975, Bell Labs released the sixth edition, known from the widely circulated comments by John Lyons. By 1978, the system was installed on more than 600 machines, primarily in universities. The seventh edition was the last single version of UNIX. It was there that a close to modern interpreter appeared command line Bourne shell.

BSD UNIX, created at the University of Berkeley, began its history in 1978. Its first version was based on the sixth edition. Released in 1979 a new version, called 3BSD, based on the seventh edition. BSD supported useful features such as virtual memory and replacing pages on demand. The author of BSD was Bill Joy. In the early 1980s, AT&T, which owned Bell Labs, recognized the value of UNIX and began creating a commercial version of UNIX. This version, which went on sale in 1982, was called UNIX System III and was based on the seventh version of the system.

An important reason for the UNIX split was the implementation of the TCP/IP protocol stack in 1980. Before this, machine-to-machine communication in UNIX was in its infancy - the most significant method of communication was UUCP (a means of copying files from one UNIX system to another, originally operating over telephone networks using modems).

Two network application programming interfaces have been proposed: Berkley sockets and the TLI transport layer interface. The Berkley sockets interface was developed at the University of Berkeley and used the TCP/IP protocol stack developed there. TLI was created by AT&T according to the transport layer definition of the OSI model and first appeared in System V version 3. Although this version contained TLI and threads, it initially did not implement TCP/IP or other network protocols, but similar implementations were provided by third parties. The implementation of TCP/IP was officially and finally included in the base distribution of System V version 4. This, as well as other considerations, caused the final demarcation between the two branches of UNIX - BSD and System V (the commercial version from AT&T).

Subsequently, many companies, having licensed System V from AT&T, developed their own commercial varieties of UNIX, such as AIX, CLIX, HP-UX, IRIX, Solaris.

In mid-1983, BSD 4.2 was released, supporting work in Ethernet networks and Arpanet. The system has become very popular. Between 1983 and 1990, BSD added many new features, such as the kernel debugger, the NFS network file system, the VFS virtual file system, and greatly improved file networking capabilities.

Meanwhile, AT&T was releasing new versions of its system, called System V. In 1983, version 1 (SVR1 - System V Release 1) was released, which included the full-screen text editor vi, the curses library, I/O buffering, and inode caching. Version 2 (SVR2), released in 1984, implemented file locking, demand paging, and copy-on-write. Version 3 was released in 1987 and included, among other things, TLI, as well as RFS support for remote file systems. Version 4 (SVR4), developed in collaboration with Sun and released on October 18, 1988, supported many BSD features, in particular TCP/IP, sockets, and the new csh command interpreter. In addition, there were many other additions such as symbolic links, ksh shell, NFS network file system (borrowed from SunOS), etc.

Modern UNIX implementations are generally not pure V or BSD systems. They implement features of both System V and BSD.

Overview of GNU/Linux-like systems

Linux runs on a variety of processor architectures such as Intelx86, x86-64, PowerPC, ARM, AlphaAXP, SunSPARC, Motorola 68000, HitachiSuperH, IBMS/390, MIPS, HPPA-RISC, AXISCRIS, RenesasM32R, AtmelAVR32, RenesasH8/300, NECV850, TensilicaXtensa and many others.

Unlike most other operating systems, Linux does not have a single "official" package. Instead, Linux comes in a large number of so-called distributions, in which the kernel Linux connects to GNU utilities and others application programs(for example, X.org), making it a full-fledged multifunctional operating environment.

The most famous GNU/Linux distributions are Arch Linux, CentOS, Debian, Fedora, Gentoo, openSUSE, Red Hat, Slackware, Ubuntu. More full list and usage percentage can be viewed at distrowatch.com

Unlike commercial systems such as Microsoft Windows or Mac OS X, Linux does not have a geographic development center. There is no organization that owns this system; there isn't even one focal point. Programs for Linux are the result of the work of thousands of projects. Some of these projects are centralized, some are concentrated in firms. Users take part in testing free software, communicate with developers directly, which allows them to quickly find and fix errors and implement new features. Most users for Linux installations use distributions. A distribution is not just a set of programs, but a series of solutions for different tasks users united unified systems installation, management and updates of packages, configuration and support.

The term "UNIX-like" and the UNIX trademark

Since 2007, there has been a dispute between Wayne R. Gray and The Open Group regarding the use of the word UNIX as a trademark. According to Trademark Trial and Appeal, Board Gray and its company are demanding that The Open Group provide it with documentation for their trademark claims.

Also, in 2007, The Open Group insisted that the German University of Kassel not use "UNIK" as an abbreviation.

Categories

Development of UNIX-like systems

UNIX systems began to appear in the late 1970s and early 1980s. Many proprietary versions, such as Idris (1978), Coherent (1983), and UniFlex (1985), aimed to provide business needs with functionality accessible to trained UNIX users.

When AT&T allowed commercial licensing of UNIX in the 1980s, many proprietary systems were developed based on it, including AIX, HP-UX, IRIX, Solaris, Tru64, Ultrix, and Xenix. This largely replaced proprietary clones. Increasing incompatibility between systems led to the creation of interoperability standards, including POSIX and the Common UNIX Specification.

Meanwhile, in 1983, the GNU project was launched, thanks to which it was possible to create an operating system that all computer users could freely use, study, fix, and rebuild. The various UNIX flavors were developed similarly to GNU, often with the same basic components. They primarily served as low-cost replacements for UNIX and included 4.4BSD, Linux and Minix. Some of them served as the basis for commercial UNIX systems such as BSD/OS and Mac OS X. Notably, Mac OS X 10.5 (Leopard) is certified by the Uniform UNIX Specification.

Examples

Most open UNIX system vendors do not seek UNIX certification for their product, even as a compromise: the cost of certification is considered unacceptable. For such systems the term is usually used Freenix. Examples are GNU, Linux, Minix, OpenSolaris, Plan 9 and BSD with their descendants such as FreeBSD, NetBSD and OpenBSD.

There are many proprietary UNIX similarities, such as AIX, HP-UX, IRIX, Mac OS X, LynxOS, QNX, SCO OpenServer, Solaris, Tru64 UNIX (based on OSF/1), UnixWare, Xenix and VxWorks.

see also

Notes

Links

  • UNIX-like Definition by The Linux Information Project
  • history of UNIX
  • Grokline's UNIX Ownership History Project

Wikimedia Foundation.

2010.

    See what a “Unix-like operating system” is in other dictionaries:

    Family tree of UNIX-like operating systems UNIX-like operating system (sometimes abbreviated as *nix) an operating system that was formed under the influence of ... Wikipedia Family tree UNIX systems

    UNIX (read Unix) is a family of portable, multitasking and multi-user... Wikipedia

    Family tree of UNIX systems UNIX (read Unix) is a group of portable, multitasking and multi-user operating systems. The first UNIX system was developed in 1969 by the Bell Labs division of AT T. Since then, it has been created ... Wikipedia Family tree of Unix-like OSs Unix-like

    (sometimes abbreviated *nix) operating system is a system that was formed under the influence of Unix. The term includes free/open operating systems derived from Bell's Unix... ... Wikipedia

    (sometimes abbreviated *nix) operating system is a system that was formed under the influence of Unix. The term includes free/open operating systems derived from Bell's Unix... ... Wikipedia

    (sometimes abbreviated *nix) operating system is a system that was formed under the influence of Unix. The term includes free/open operating systems derived from Bell's Unix... ... Wikipedia

    (sometimes abbreviated *nix) operating system is a system that was formed under the influence of Unix. The term includes free/open operating systems derived from Bell's Unix... ... Wikipedia

    (sometimes abbreviated *nix) operating system is a system that was formed under the influence of Unix. The term includes free/open operating systems derived from Bell's Unix... ... Wikipedia

There are a great many different *nix systems and Linux/BSD distributions. It happens that one or another function or program that you are used to in your favorite system, suddenly for some reason is not available in another. Are there any analogues or a way to make it work?

Running Skype on FreeBSD

It is known that Skype version ports are, to put it mildly, outdated - for example, it is not possible to make video calls. Using the Windows version via Wine is not an option - it will not run under Wine. But there is a way out - install a compatibility layer with Linux, then, after applying a patch to the kernel and then recompiling it, install Skype. We will describe exactly how to do this.

The first step is to build the emulators/linux-base-c6 port - in this case, if a Flash plugin is needed, you need to perform some actions, namely in the makefile of this port comment out the following line:

CONFLICTS=linux_base-gentoo* linux_base-f* linux-glib2-*

Then type the commands:

# sysctl compat.linux.osrelease=2.6.18 # make patch

The first will set the kernel version to 2.6.18 (then you will need to set this variable in /boot/loader.conf so that it does not reset after a reboot), and the second will apply the patch we just made. After that, copy the following libraries from the work directory to /compat/linux/:

Lib/ld-2.12.so lib/ld-linux.so.2 lib/libc-2.12.so lib/libc.so.6 lib/libdl-2.12.so lib/libdl.so.2 lib/libgcc_s-4.4. 6-20110824.so.1 lib/libgcc_s.so.1 lib/libglib-2.0.so.0 lib/libglib-2.0.so.0.2200.5 lib/libpthread-2.12.so lib/libpthread.so.0 usr/ lib/libstdc++.so.6 usr/lib/libstdc++.so.6.0.13

Let's create a symlink from usr/lib/libtiff.so.3 to libtiff.so.4:

# ln -s libtiff.so.3 libtiff.so.4

All these steps are only necessary if you need the www/linux-f10-flashplugin port.

The next step is to replace the header file to support video calls (necessary if the FreeBSD version is lower than nine):

# cd /usr/ports/multimedia/linux_v4l2wrapper-kmod # make patch # mv -i /sys/compat/linux/linux_videodev2.h(,.bak) # cp -i work/linux_v4l2/linux_videodev2.h /sys/compat/ linux

and rebuild the kernel. This is necessary so that Linux ioctl calls translate normally into FreeBSD calls.

You will also have to install the multimedia/webcamd port:

# cd /usr/ports/multimedia/webcamd # make install clean

And now you can finally install Skype - but not just any version, but a specific one. Take it from here, unpack it into your home directory and, if everything is configured correctly, enjoy it.

Running OS X Applications on Linux

There are quite a few for OS X interesting applications. However, the Mach-O executable file format used in Apple's OS differs from ELF, and the API, although POSIX-compatible, is still incompatible with Linux. At the end of 2012, the Darling project was presented, which is positioned by the developers as a means for launching development tools. On this moment Very few applications are supported (mostly console ones), but I would like to hope that their number will grow steadily. The project, in particular, uses GNUStep, a free implementation of the Cocoa API that is used in OS X.

Building Darling will require installing many packages, including the clang compiler:

$ sudo apt-get install git cmake clang nasm g++ checkinstall libxml2-dev libgnutls-dev libicu-dev libcairo-dev libjpeg-dev libpng-dev libtiff-dev libbsd-dev libudev-dev liblcms-dev libkqueue-dev libssl-dev libbz2- dev uuid-dev libncurses-dev libxrandr-dev

We get the GNUStep Make utility from the Git repository, compile and install:

$ git clone https://github.com/gnustep/gnustep-make.git $ cd gnustep-make $ CC=clang CXX=clang++ ./configure $ sudo make install

We assemble the Objective-C support library - GNUstep Libobjc2:

$ git clone https://github.com/gnustep/gnustep-libobjc2.git $ cd gnustep-libobjc2 $ OBJCFLAGS=-fblocks CC=clang CXX=clang++ cmake . $ rm GNUmakefile $ make $ sudo make install

Then the basic part of GNUStep:

$ git clone https://github.com/gnustep/gnustep-base.git $ cd gnustep-base $ OBJCFLAGS=-fblocks CC=clang CXX=clang++ ./configure $ make $ sudo make install

$ git clone https://github.com/gnustep/gnustep-gui.git $ cd gnustep-gui $ OBJCFLAGS=-fblocks CC=clang CXX=clang++ ./configure $ export LD_LIBRARY_PATH=/usr/local/lib $ echo export LD_LIBRARY_PATH=/usr/local/lib >> ~/.bashrc $ make $ sudo make install

GNUStep CoreBase, which is an analogue of CoreFoundation, is also necessary:

$ git clone https://github.com/gnustep/gnustep-corebase.git $ cd gnustep-corebase $ OBJCFLAGS=-fblocks CC=clang CXX=clang++ ./configure $ make $ sudo make install

The analogue of Quartz 2D - Opal, responsible for rendering, also needs to be assembled:

$ git clone https://github.com/gnustep/gnustep-opal.git $ cd gnustep-opal $ OBJCFLAGS=-fblocks CC=clang CXX=clang++ make $ sudo make install

Finally, you need to compile Darling itself:

$ git clone https://github.com/LubosD/darling.git $ cd darling $ CC=clang CXX=clang++ cmake . $make

That's it, you can launch OS X applications by entering the command:

./dyld <аргументы>

Installing deb packages on Red Hat-like systems

The RPM and deb package formats are incompatible with each other - and on the same system these two package manager don't get along. Typically, the need to install packages non-native system is rare. But if it does occur, you can use the alien package conversion tool. Of course, this is not a panacea - not all packages can be converted with its help, and it must be used with caution. Let's download its sources, unpack and install:

# wget http://ftp.de.debian.org/debian/pool/main/a/alien/alien_8.88.tar.gz # tar xzvf alien_8.88.tar.gz && cd alien # make && make install

I will describe some command line options related to conversion to RPM.

  • -r - actual conversion to RPM;
  • -i - installs the resulting package from the conversion and removes the package file from the system;
  • -g - creates the required directory with files, but does not create the package itself;
  • -c - converts scripts. This option must be used with caution, as Ubuntu scripts will not work with RHEL.

As an example, let's convert the zsh package and install it:

# wget http://goo.gl/Fykuzu # alien -r ./zsh_4.3.17-1_i386.deb # rpm -ivh --nodeps ./zsh-4.3.17-2.i386.rpm

We install this package forcibly - alien in this case converted the dependencies rather strangely. To be more specific, for some reason the file /bin/zsh was needed to install the package, while we are installing it. It is also worth noting that the names of the package files are also converted and the last digit of the converted package version is incremented by one.

In my case, the package installed fine and zsh started without problems. But it would be worth warning once again that this method should be used with caution.



Updating the kernel without rebooting

On Linux, there are two solutions to minimize the number of hardware reboots - kexec and ksplice. The kexec system call appeared in the mainline version of the kernel in June 2005. It is intended to load a new kernel directly from an existing one. This technology works this way:

  • First, the kernel image is copied into memory;
  • this image is then moved to the current kernel's heap;
  • finally the image is copied to required pages, and control is transferred to it.

Advantages this method before a normal reboot are obvious: the reboot is faster, in the case of SCSI controllers there is no need to wait for device detection, relative independence from bootloaders and the ability to quickly switch to another installed distribution. However, there are also disadvantages. First, before loading the kernel, it is recommended to correctly shut down all processes and synchronize file systems, since all kernel subsystems are initialized anew. Secondly, all devices will be in an unknown state, and if the driver is written crookedly, it will not work.

For practical application kexec requires a kernel with the option enabled (CONFIG_KEXEC=Y) and the kexec-tools package. Manually loading the kernel (in the case of Ubuntu) is carried out with the following two commands:

# kexec -l /vmlinuz --initrd=/initrd.img --reuse-cmdline # kexec -e

The first command loads the kernel into memory, and the second transfers control to it. This uses the current kernel parameter line. To use your own parameters, set them in the --cmdline="" option.

In Ubuntu, you can also use kexec for a quick reboot - to do this, set the LOAD_KEXEC parameter in the /etc/default/kexec file to true, and after that all standard reboot procedures will be carried out through it.

Ksplice, according to its developers, allows you to apply security patches to the kernel on the fly. At the same time, all running applications continue to work without the need to restart them. The project was purchased by Oracle, and for RHEL, due to competition between companies, patches are paid. This, however, does not stop us from distributing patches for Ubuntu. Download and install the package (for version 12.04):

$ wget http://goo.gl/MHAZ6c $ sudo dpkg -i ./ksplice-uptrack.deb $ sudo apt-get -f install

Applying all available patches is done with one simple command:

$ sudo uptrack-upgrade -y

To remove all patches, use the command

$ sudo uptrack-remove --all -y

In general, this technology works quite stably - the fact that Oracle bought it speaks for itself. However, only those patches that do not make significant changes to the kernel structure can be installed in this way.

NetBSD Kernel Modules on Linux

A few months ago, the NetBSD team was able to get NetBSD kernel modules running on Linux. This can be used, for example, to mount FFS2 partitions, as well as add other NetBSD-specific features not supported on Linux.

The developers were able to load modules compiled for the NetBSD kernel by using so-called RUMP kernels (Runnable Userspace Meta Programs). The RUMP kernel is an ultra-lightweight kernel that runs in user mode. There are three implementations of running such kernels:

  • implementation as a POSIX process. It is the main one and allows you to run RUMP kernels as user processes on POSIX-compliant systems;
  • implementation for Xen, which allows you to launch the RUMP kernel directly in DomU, without the need to install a full-fledged OS and run it in it;
  • implementation in the Linux kernel for running RUMP kernels directly in kernel space.

Note that RUMP kernels are not virtualization - they are designed to execute exclusively kernel modules, and processes from the host system can use them. As a result of such architectural decisions, the RUMP kernel turned out to be truly lightweight - it occupies about 100 KB of memory. The advantages, according to the developers, are:

  • many things, such as the TCP/IP stack, can use RUMP kernels without requiring a full OS;
  • the ability to launch several RUMP kernels with different functionality - for example, the same TCP/IP stack can be launched for different purposes and, accordingly, will be optimized differently;
  • security - each RUMP kernel runs in its own address space, and the risk of hacking (in the case of NetBSD is not very large due to its low prevalence), for example, through vulnerable FS drivers, becomes even more unlikely;
  • the ability to develop and test kernel code in user mode, which is much more convenient than using virtual machines.

However, this is all theory, and it’s time to move on to practice. To compile the RUMP kernel, you need to get the buildrump.sh tool, for which we use Git:

$ git clone https://github.com/anttikantee/buildrump.sh.git $ cd buildrump.sh $ ./buildrump.sh

Then you need to get an archive with kernel modules. Since it is in a snapshot and its date is constantly changing, the exact address I can’t give it, but in my case the command to get it was as follows:

$ wget http://goo.gl/gNCALo

Extract the module you need to your working directory. Following this, you will most likely need to compile the utilities for use with the RUMP kernel, specifying the paths to the header and library files.


Using Windows Network Drivers with NDISWrapper

Modern Linux can handle a huge number of titles network equipment. However, separate network devices(such as wireless adapters) in Linux either do not work quite correctly, or even have a driver only for Windows. But there is a way to run Windows versions of some network drivers on Linux. To do this you need to use NDISWrapper.

As the name suggests, it is a wrapper tool for NDIS-compatible drivers. It provides them with the minimum required set of ntoskrnl and hal functions. And what's most amazing is that it all works.

In order to use it, install the appropriate package:

$ sudo apt-get install ndiswrapper-common ndiswrapper-dkms cabextract

Then we add the native Linux driver (one of the Broadcom chipsets will be used as an example below) to the blacklist so that there is no conflict:

/etc/modprobe.d/blacklist.conf #<...>blacklist bcm43xx

If the driver is in an exe or cab archive, you may need cabextract.

$ cabextract setup.exe

Take the driver files and install it using ndiswrapper:

$ sudo ndiswrapper -i bcnwl5.inf

We register the kernel module in startup by adding the line ndiswrapper to the /etc/modules file and load it:

$ sudo modprobe ndiswrapper

If everything is configured normally, the network will work.


Hot switching of video cards

Modern video adapters support hot plugging - of course, provided that you have a second adapter. Linux (or more precisely, X.Org) has recently also supported this technology. This will not require any special movements on the part of the user - all he needs to do is simple connection devices. In this case, of course, it must be installed latest version X.Org with xf86-video-modesetting driver. However, it’s worth describing in a little more detail exactly how it works.

When starting the X server this driver boots using udev. In this case, instead of actually displaying the screen, the X server creates an abstraction called Screen, and onto it projects DrvScreen, which is precisely a physical device. When you connect a second video card, another instance of DrvScreeen is created, and all activity on Screen is duplicated on both devices.

Unlike the similar Xinerama technology, this technology does not work at the X11 protocol level, but at the level of interaction with equipment. In this case, you don’t have to worry about which adapter the output is generated from - you can perform all resource-intensive actions on one, more powerful video card, and then transfer the image to a low-power one.

The technology is quite new, not time-tested, but promising. If you have two video cards, you can try it out right now.

Porting software using Docker

There are many ways to create and run applications in isolation on Linux. Some of them are complex, some are simpler, but many require the deployment of a file system, which can take a long time. Relatively recently, cloud hosting company DotCloud opened the Docker project. It is written in Go and is designed to manage LXC containers, extending and complementing their basic capabilities. It allows you to isolate not the entire system, but only individual processes and clone/transfer them to other computers (of course, with the same hardware architecture). The project is intended for the transfer of projects, all kinds of deployment and automation of distributed systems. Its main features:

  • the ability to place various loads in a container - scripts, binaries, libraries, Jar files...
  • portability - it runs on any modern x64 processor with new Linux kernels (a kernel of at least 3.8 with AUFS support is recommended);
  • isolation of processes from the main system and from other isolated processes;
  • since each container uses its own file system, it does not matter in what environment it is launched;
  • due to the fact that this isolation of sufficiently high-level entities, machine time is not lost on virtualization.

Installation on Ubuntu 12.04 will require updating the kernel to version 3.8, which, fortunately, is backported from 13.04:

# apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring # reboot

After the reboot, add a PPA with Docker and install it:

# apt-get install python-software-properties && add-apt-repository ppa:dotcloud/lxc-docker # apt-get update # apt-get install lxc-docker

Docker is installed.

Here are the most commonly used commands:

  • docker pull - get an image from the repository;
  • docker run - run an application in a container;
  • docker ps - view executable containers;
  • docker diff - view changes in the container file system;
  • docker commit - save changes to the image.

As an example, let's install the Redis daemon. First of all, let's run Docker in daemon mode and get a base image.

$ sudo docker -d & $ sudo docker pull ubuntu

Running via sudo is necessary here for the reason that the daemon is launched as root and uses a UNIX socket, which is also owned by root. If you create a docker group and include yourself in it, this will not be necessary. In what follows, it is assumed that this is exactly what was done.

Launch the shell and install Redis:

$ docker run -i -t ubuntu /bin/bash # apt-get update # apt-get install redis-server # exit

Let's take a snapshot with installed server. To do this, you first need to find out the container identifier:

$ docker ps -a

The resulting ID must be used in the following command:

$ docker commit 691b3214f7de rom/redis

Finally, we launch Redis in background, forwarding port 6379 to the container:

$ docker run -d -p 6379 rom/redis /usr/bin/redis-server

Redis is ready to use.

INFO

Compiled Docker packages are only available for the x64 platform; they are not available for x86.

Conclusion

The article described several ways to do what was seemingly impossible. However, it is quite difficult to consider all scenarios, especially since *nix systems are flexible - they always have more than one way to do something.

Today users personal computers A wide selection of operating systems is provided. By far the most common among them are operating systems. Windows family and, to a lesser extent, Linux. What to choose? In most cases, laptops already have one or another licensed operating system preinstalled. For ease of selection, Windows operating systems have names corresponding to their area of ​​use. For example:

  • Windows 7 Starter – Operating system for netbooks. Differs exclusively in 32-bit execution, limited functionality Windows interface Aero, the lack of a function for quickly switching between users, the inability to change the desktop background and does not support 64-bit processors. This operating system is sold only as a pre-installed OS; it is not possible to buy it in a boxed version.
  • Windows 7 Home Basic is an inexpensive operating system for home use. It still lacks built-in Windows Media Center Edition (MCE) Windows support Aero and Multi-touch support. But there is a standard Windows interface and quick switching between users. This operating system can be purchased in a boxed version.
  • Windows 7 Home Premium is an advanced system for home use with advanced features. It has built-in Windows MCE, support for up to 4 TV tuners, a full Windows Aero interface, is compatible with Dolby Digital and supports multi-touch. The boxed version contains 2 DVD discs - with 32 and 64-bit versions of the distribution. This OS can be installed on 2-processor workstations.
  • Windows 7 Professional is an operating system for working with advanced features. An even more reliable system (due to some functions) for business users. Has advanced network capabilities. It also boasts a license for XP Mode and the ability to search for the preferred printer for selected networks. Included with a laptop with such an operating system you can often find Windows distribution XP.
  • Windows 7 Ultimate - the name speaks for itself - a universal system for performing any task. Ideal for businesses.

If desired, you can always purchase and install the required operating system (except Windows Starter) on your laptop yourself. If you already have a previously purchased “Box” version of the operating system, then it makes sense to purchase a laptop without an operating system so as not to overpay for a pre-installed OS.
at - indicating the time when the command is executed
chown - change the owner of a file
batch - execute a command while loading
telnet - telnet client
ftp - ftp client
rmdir - remove directory
finger/who/users - display a list of people working in the system.
gcc - C compiler
ftpwho - finger for ftp
mv - move file
kill - stop the process
cat - text editor
ls - directory browsing
chmod - change file access privileges
rm - delete file
id - view rights, i.e. uid and gid
mail - well, like, working with soap
cat |less - if the terminal does not allow scrolling.
cd - change directory
cron - daemon of at and batch commands
logname - getting the login name
cp - copy something.
uname-a - everything about the system version.
crontab - set time reserves between program launches.
ps - view the list of processes.
pwcheck - view the default password file.
umask - mask for a specific file.
su - su program
sleep - stop the process.
passwd - working with passwords.
news - usenet display
write - message to the current user.
uux - execute commands on a remote computer
nslookup - hydromedical center reports about IP
uucp - copying a file from/to a remote computer
more - text editor output in page mode
screen - super convenient if you access the server via sssh and have a bad connection.
top - view CPU usage by processes.
grep - search for a line in a file using a given key
grep -i - the same, not case sensitive.
uuencode - creating a text version of a binary file (for soap)
uudecode - well, kind of the opposite of the previous one.
tar - creating archives of files.
uncompress - getting the original from compressed file.
* login - a request from the user for a name and password (a request from the system to the user) to log into the system (by default, when entering a password, it is not displayed).
* logout - exits the current shell session.
* startx - command to start GUI X Window (not to be confused with the Windows system. Don't be afraid. It's not that).
* shutdown - stops the system and prevents damage to the file system in the process, but is only used when working in console mode. When working in X Window mode, do not use.
* halt - fast and correct system shutdown.
* poweroff - correct system shutdown.
* reboot correct shutdown with subsequent boot. Reboot.
* vmstat - displays information about processes, memory and load central processor.
* su - log into the administrator session, but you will have to enter a password. To exit this session, type exit and press ENTER.
* apropos - search for a string in the titles and titles of the documentation (additionally enter a search word). Gives a list of everything found.
* cal - formatted calendar for the current month (add y and there will be a calendar for the entire current year).
* date - displays the current date and time according to the kernel system clock.
* oclock - a simple clock that hangs on the desktop (many additional parameters).
* finger - display information about the user whose name is specified in the command.
* hostname - the command displays the identifier of this network host (its name). root - can change the node name to a new one.
* hwclock - the built-in clock of your computer. To change the date and time and synchronize with the system clock, root privileges are required.
* pwd - displays full path to the current directory.
* tzselect - launches a utility that allows you to select a time zone.
* uname - displays information about the used operating system(when you enter additional command parameters, it produces quite a lot of information).
* uptime - shows the current time, session duration, number of users and processor load.
* users - displays a short list of users currently working in the system.
*w- detailed information about all users currently working and also simple, login, etc. If you need one user, then specify the name in the parameter.
* whatis - search the database of manual pages and display brief description.
* who - list of users currently working in the system.
* whereiz finds files, man pages for the specified command.
* which - shows the full path to the command's executable file.
* whoami - shows the current user ID working in this terminal.
* write - sends a message to another user on the system by copying lines from the sender's terminal to the recipient's terminal.
* wall - sends a message to the terminal of each user currently logged into the system.
* history - shows a numbered list of commands that you executed in this and the previous session. If there are quite a lot of them in the history list, you will see the latest ones.
* jobs - displays a list of all running and suspended tasks.
* kill - kill the process (you must specify which one).
* killall - will allow you to manage processes using their names or file names, and not identifiers as in kill. All specified processes are terminated.
* kernelversion - shows the major and minor versions of the kernel.
* nice - allows you to display or configure the task priority.
* ps - displays a list of all running processes.
* pstree - shows the hierarchy of system processes, which clearly shows their interdependence.
* renice - sets the priority for the specified task.
* script - allows you to write all output from the terminal to a file. To stop recording, press Ctrl+d. If the file name is not specified, it is written to typescript.
* times - shows the total execution time of processes for the entire system and given user.
* top - launches a program that allows you to manage processes. And a lot of additional, useful information.
* cd - change the current directory. By default goes to the home directory current user(if without parameters).
* dir - displays files in the current directory in alphabetical order and case sensitive.
* file - shows the content type of the specified file (text, executable, data).
* find - search for files in the current directory. If you specify a path, you can search everywhere.
* free - displays information about random access memory, swap, cache, free memory, shared, etc.
* ls - shows all files in the current directory in alphabetical order. Similar to dir.
* last - shows a list of users who have logged in since the /var/log/wtmp file was created.
* lastlog - checks the login history of registered users. Formats and prints the /var/log/lastlog file.
* logger - sends a request to the syslogd daemon with a request to place a message in the system log.
* lpr - sends the document to the print daemon for printing.
* chmod - changes the file access mode. Character or numeric format.
* chown - change the owner of the specified file. Required root access.
* chage - used to change the validity period of an account. For administration.
* chfn - changes user information in the /etc/passwd file from which the finger command takes information.
* chgrp - command for the administrator to change the group of file owners.
* clear - clears the terminal screen (if possible).
* crontab - provides the ability to perform certain tasks on a schedule. It is most often used by the administrator, although users may also have their own tasks.
* csplit - splits the file into several parts. You must set the splitting method (lines, etc.).
* cp - copies one file to another, or several files to a directory.
* dd - copying a file while simultaneously performing various additional transformations.
* dc - calculator.
* debugfs - used to restore the file system (ext2,ext3) if the fsck command is not enough.
* df - shows the amount of used and free disk space for all mounted file system partitions.
* du - shows the number of disk blocks occupied by each directory file.
* mc - launches the Midnight Commander file manager program in a text console. It resembles MSDOS managers and is quite simple and easy to use. There are a lot of necessary and convenient functions.
* mkdir - creates the specified directory.
* man - reference manual.
* mcat - copies raw data to a floppy disk.
* mcopy - uses a formatted MSDOS floppy disk to copy files to and from Linux without first connecting the floppy disk to the file system.
* mdel - deletes a file on a formatted MSDOS floppy disk.
* mdir - displays the contents of a directory on an MSDOS floppy disk.
* mdu - shows the disk space occupied by the MSDOS directory.
* mesg - controls access to your terminal so that colleagues cannot bombard you with messages using the write command
* mformat - creates on a floppy disk file system MSDOS.
* mkbootdisk - used in some distributions to create a boot floppy disk containing everything necessary for an emergency boot.
* mktemp - creates a unique file name for temporary work.
* mlabel - creates a volume label on MSDOS on a formatted floppy disk.
* mmd - creates a MSDOS subdirectory on a formatted floppy disk.
* mmount - connects a formatted MSDOS device to the file system.
* mmove - moves or renames a file on an MSDOS floppy disk.
* more - a tool for page-by-page viewing of a text file.
* mv - renames or moves files or directories.
* rm - deleting the specified file. You can delete a lot.
* rmdir - deleting the specified empty directory.
* safedelete - deleting the specified file to the safedelete directory, where it is stored for some time before being permanently deleted.
* stat - display all available information about the specified file.
* touch - changes the time the file was last accessed or modified to the current time.
* undelete - restores files deleted by the team safedelete.
* wc - shows the number of lines, words and characters in the file.
* bunzip2 - unpacks the specified file 30% faster than gzip.
* bzip2 - compresses the specified file using an accelerated algorithm.
* bzip2recover - attempts to recover data from a damaged bzip2 compressed file.
* compress - compresses the specified file using a different algorithm.
* uncompress - uncompresses a file compressed by the previous command.
* cpio - allows you to create archives and extract files from archives. Allows you to copy files. The appropriate parameters must be specified.
* gpg - allows you to encrypt and decrypt a file. Public key encryption method. Allows you to create electronic signatures. If you do not have this program, [You must log in or ]
* gzip - compresses the specified file.
* gunzip - unpacks the specified file (extensions .Z, .gz, .tgz, .zip).
* gzexe - allows you to compress an executable file with the specified name so that it is automatically unpacked and executed when the user gives a command to execute the compressed file.
* gpasswd - sets the group password.
* mcrypt - Encrypts the specified file. Created new file in the working directory with the extension .enc. You will be prompted to enter your password. Don't forget it.
* mdecrypt - decrypts the same file. If these utilities are not available, [You must log in or ]
* tar - places two or more files into a new or existing archive or extracts them from an archive. When given a directory, archives all files in the directory and subdirectory.
* talk - allows you to conduct an interactive dialogue with an INTERNET user.
* tee - sends output data to two output devices. You can simultaneously output it to the screen and to a file.
* toe - displays information about existing terminals that can be used for further work.
* touch - changes the file creation time to the current one. If the file does not exist, it creates a new, empty file.
* unarj - unpacks or lists the contents of the specified archive in .ARJ format (MS DOS compression format).
* unzip - unpacks and extracts files from archives created by ZIP utilities (Linux, MS DOS, Microsoft Windows).
* zip - archives and compresses files.
* zipinfo - displays information about the contents of the archive. If you specify a name, it will display information about a specific file.
* zipnote - allows you to display and edit comments on files from a ZIP archive.
* zipsplit - allows you to split zip archive into small enough parts to record them on removable media, and writes files to the specified device (floppy disks).
* zforce - adds the .gz extension to all files in the working directory, or to the specified file, that have been compressed but do not have an extension. prevents re-compression.
* uuencode - encodes a binary file for transmission over ASC11 networks.
* uudecode - decodes the above named file.
* autorun - automatically recognizes all available CDROM drives in the system, mounts them when a disc is inserted and can launch individual applications (for example a player). To use, you need to add parameters to the drive file.
* badblocks - check the specified device for bad sectors (specify the device).
* eject - ejects media from the specified device. If the device is mounted, the command unmounts it before ejecting the media.
* e2fsck - checks and, if necessary, repairs a damaged file system volume (ext2, ext3).
* echo - prints a line of text to the standard output device.
* fdformat - formatting a floppy disk. Additionally, enter the device name and the required type of formatting.
* fg - switches a process running in the background to foreground mode.
* fgconsole - shows the number of active virtual consoles.
* fsck - checks and repairs the file system.
* mount - mount the file system.
* umount - unmount the file system (in both commands you must specify what exactly).
* rdev - when called without parameters, displays information about the current file system.
* rcp - used to copy files from one computer to another.
* rdate - receives the date and time value from another network node. Used to synchronize the system time of nodes.
* rename - renames files. Very convenient when there are a lot of files.
* resize - changes the size of the virtual terminal window in the graphical environment.
* restore - restores files archived using the dump command.
* runlevel - displays the current and previous run levels.
* shred - performs safe deletion file by first overwriting its contents on another disk.
* sleep - pauses the start of the process for a specified number of seconds.
* usleep - pauses for microseconds.
* sync - clears file system buffers.
* cmp - makes a quick comparison of two specified files. If they are identical, then no messages are displayed.
* column - formats the input text from the specified file into a list of five columns.
* diff - compares two specified text files. Each difference is displayed in context. Allows you to compare directories.
* diff3 - compares three specified files and displays the results.
* enscript - converts the specified text file in Post Script format. The output can be sent to print or written to a file.
* fmt - this utility formats each line in the specified file so that all lines have the same width.
* head - the utility displays the first ten lines of a file. Several files are possible.
* ispell - launches an interactive utility to check spelling in the specified file.
* id - displays the effective user and group ID values ​​for the current user.
* ifconfig - displays the status of the current network configuration or configures the network interface.
* less - displays the contents of the specified file on the screen and allows you to conveniently view it.
* nl - the command numbers lines in the specified file.
* paste - combines the corresponding lines of files into columns. If desired, you can combine several files.
* pdf2ps - converts the file PDF format in Post Script. The result is written to disk.
* pdftotext - converts a file from PDF format to text and writes the result to disk.
* pr - prepares text for printing, formatting it into pages. You can prepare several files.
* sort - the command allows you to sort the lines of a file in alphabetical order.
* split - splits the file into parts.
* zcat;zmore - displays the contents of a gzip compressed file on the screen without decompressing it.
* zcmp - compares gzip-compressed two files without decompressing.
* zdiff - compares gzip compressed two files without decompressing.
* zegrep;zfgrep;zgrep - searches for a specified string or expression in a gzip compressed file, without unpacking.
* aumix - launches a utility in interactive mode that manages various settings sound card.
* cdda2wav - a utility designed to record audio tracks from an audio CD into WAV format files. If the file name is not specified, then the recording goes to the audio.wav file in the current directory.
* cdlabelgen- command is intended for preparing covers for CD boxes. The result is in a Post Script file format. A Perl language interpreter of at least version 5.003 is required.
* cdp - launches the audio compact disc player in text mode.
* cdparanoia - reads audio tracks from audio compacts and writes to WAV, AIFF, RAW files.
* combine- combines two or more graphic files into one. A huge number of special effects. Is part of the Image Magick package, they can be taken [You must log in or ]
* convert - converts the specified input graphic file, on weekends. Recognizes many formats. Download in the same way as the previous one.
* identify - determines the format and characteristics of a graphic file and checks the integrity and presence of errors.
* mogrify - converts a graphic file and overwrites the original one.
* montage - converts multiple files into a combined image. [You must log in or ]
* mpg123 - plays an audio file in MP3 format on the main playback device. Enter the file name or its Internet address. To stop playback Ctrl+c. To stop and exit the program, press Ctrl+c twice.
* play - reproduces sound file with the specified name. Automatically recognizes the file type. Allows you to add various sound effects to played files.
* playmidi - plays sound files in MIDI format.
* rec - records input from microphone or other inputs into an audio file. The file type should be specified using the (type) parameter. It is possible to add sound effects.
* sox - converts samples from format input signal, for the weekend with added effects.
* emacs - launch text editor Emacs.
* joe is an easy-to-use editor that works in text mode.
* pico is a simple and easy-to-use text editor. Convenient for editing configuration and simple files.
* vi - launch the classic VI text editor for UNIX systems.
* dmesg - displays kernel messages on the screen, including those displayed at startup and afterwards. To make it easier to read, enter dmesg|less.
* groupadd - creates a user group with the specified name.
* groupdel - deletes a group with the specified name.
* groupmod - changes the parameters of the group with the specified name.
* mkpasswd - Creates a high-quality password that is nine characters by default and contains at least mixed-case letters and numbers.
* passwd - allows the user with the specified name to change the password of his account. root can change any user's password.
* pwgen - creates a high-quality password that is easy to remember. The length of the password is indicated by a number. If this utility is not available,
* quota - Shows current disk usage statistics and current restrictions for the user or group with the specified name.
* quotacheck - examines the file system for disk space usage.
* quotaon - enables or disables restrictions on disk space usage.
* rpm launches the package manager, a utility that allows you to install, check and update packages with the rpm extension.
* rpmfind - search for the required package in the RPM package database via the INTERNET.
* tmpwatch - deletes all files in the specified directory if they have not been accessed within the last n hours. Clears temporary directories.
* useradd - creates a new user with the specified name.
* userdel - deletes a user with the specified name.
* usermod - changes the parameters of the user with the specified name.
* fetchmail - mail receiving utility. Works in the background. Downloads mail from the specified server. If it is not there, [You must log in or ]
* ftp - establishes a connection with the specified node and allows you to download or upload files.
* lynx - launch a console WEB browser.
* mail - utility for editing and viewing email. Sending and receiving letters.
* netstat - displays information about the network subsystem. There are a lot of settings and parameters.
* ping - sending packets to a specified address to check the possibility of connecting to this node.
* telnet - opens a terminal window on a remote host and starts an interactive session.
* wvdial- the program connects to the INTERNET via the PPP protocol using the parameters stored in the /etc/wvdial.conf file
* wvdialconf - searches for a modem, determines the port to which it is connected, its initialization string and maximum speed data transfer. This information is automatically written to a file (see above). Root access required.
* ar is an archiving tool designed to create and unpack an archive.
* arch - displays information about the architecture of the central processor.
* at - queues jobs for later execution at a specified time.
* atq - shows a list of tasks that are queued for execution.

Loading...
Top