Linux Basics - Command Line and File System. Linux Basics Merging File Systems

Before you can master , you must be fluent in the basic concepts of the Linux system. Knowing how to work with Linux will be a very useful skill because a large number of websites run on Linux servers, email and other Internet services.

IN this section we are going to explain the basic concepts related to Linux. In carrying out the task assigned to us, we believe that you already have an understanding of computer systems in general, including such components as the central processing unit (CPU), random access memory (RAM), motherboard, hard drive, as well as other controllers and devices associated with them.

3.1

The term "Linux" is often used to refer to the entire operating system, but Linux is actually the operating system kernel that is launched by the boot loader launched by the BIOS/UEFI. The kernel takes on a role similar to that of a conductor in an orchestra, ensuring that hardware and software operate in harmony. This role involves managing equipment, users and file systems. The kernel is a common base for other programs running on a given system, and most often runs ring zero also known as kernel space.

User space

We use the term "user space" to encompass everything that happens outside the kernel.

Among the programs that run in user space are many of the core utilities from the GNU project, most of which are designed to be run from the command line. You can use them in scripts to automate various tasks. Additional information For the most important commands, see section 3.4 " ".

Let's quickly take a look at the various tasks performed by the Linux kernel.

3.1.1 Equipment startup

The purpose of the kernel is, first of all, to manage and control the main components of the computer. It detects and configures them when the computer is turned on and when a device is mounted or removed (for example, USB device). It also makes them accessible to higher-level software through a simplified software interface, so applications can take advantage of the devices without having to deal with details like the expansion slot into which the card is inserted. The programming interface also provides a certain level of abstraction; this allows you to use equipment for video conferencing, for example, use a webcam, regardless of its model and manufacturer. The software can use the interface Video for Linux(V4L) and the kernel will translate interface calls into actual hardware commands needed to operate a specific webcam.

The kernel exports data about detected hardware via virtual systems/proc/ and /sys/ . Applications often access devices using files created in /dev/ . Special files representing disks (for example /dev/sda), partitions (/dev/sdal), mice (/dev/input/mouse0), keyboards (/dev/input/event0), sound cards(/dev/snd/* ), serial ports(/dev/ttyS*) and other components.

There are two types of device files: block and character. The former have the characteristics of a data block: they are finite in size and you can access bytes at any position in the block. The latter behave like a stream of characters. You can read and write characters, but you cannot search for a given position and modify arbitrary bytes. To find out the device file type, check the first letter of the Is -1 command output. This can be either b, for block devices, or c, for character devices:

As you may have guessed, disks and partitions use block device files, while the mouse, keyboard, and serial ports use character device files. In both cases, the programming interface includes special commands that can be activated via a system call ioctl.

3.1.2 Merging file systems

File systems are an important aspect of the kernel. Unix-based systems combine all file stores into a single hierarchy, allowing users and applications to access data by knowing its location within that hierarchy.

The starting point of this hierarchical tree is called root, represented by the symbol “/”. This directory may contain named sub-directories. For example, the home sub-directory "/" is called /home/. This sub-directory, in turn, may contain other sub-directories, etc. Each directory can also contain files in which files will be stored. So home/buxy/Desktop/hello.txt refers to a file called hello.txt which is stored in the Desktop sub-directory, which is in the buxy sub-directory of the home directory, which is present in root. The kernel compiles between a given naming system and a disk storage location.

Unlike other systems, Linux has only one such hierarchy and can integrate data from multiple disks. One of these disks becomes root, and the others are mounted on a directory in the hierarchy (this command in Linux is called mount). These other drives are then made available under mount points ( mount points ) This allows the user's home directories (which are usually stored in /home/ ) to be stored on a separate hard drive, which will contain the buxy directory (along with other users' home directories). Once you have mounted the drive to /home/ , these directories become accessible in their normal location, and various paths such as /home/buxy/Desktop/hello.txt continue to work.

There are many file system formats to match the many ways data can be physically stored on disks. The most widely known are ext2, ext3 and ext4, but there are others. For example, VFAT is a file system that was historically used by DOS and Windows operating systems. VFAT support by the Linux operating system allows hard drives be available on both Kali and Windows. In any case, you must prepare the filesystem on the disk before you mount it, and this operation is called formatting.

Commands such as mkfs.ext3 (where mkfs stands for MaKe FileSystem) handles formatting. These commands require as a parameter a device file representing the partition to be formatted (for example, /dev/sdal, the first partition on the first disk). This operation destroys all data and should only be run once, unless you want to wipe the file system and start over.

There are also network file systems such as NFS, which do not store data on local disk. Instead, the data is transmitted over the network to a server, which stores it and makes it available on demand. With file system abstraction, you don't have to worry about how that drive is mapped, since the files remain accessible in their normal hierarchical path.

3.1.3 Process management

A process is an executable instance of a program that requires memory storage for both the program itself and its working data. The kernel is responsible for creating and tracking processes. When a program runs, the kernel first allocates some memory, loads executable code from the file system into that memory, and then runs the code. It contains information about this process, the most prominent of which is an identification number known as process id (process identifier(PID)).

Most modern operating systems, namely those that run on the Unix kernel, including Linux, are capable of performing many tasks. In other words, they allow the system to run many processes at the same time.

There is actually only one running process at any given time, but the kernel divides the CPU time into small chunks and runs each process in turn. Because these time slices are very short (in milliseconds), they give the appearance of processes running in parallel, although they are active only during their time interval and idle the rest of the time. The main goal of the kernel is to tune the scheduling mechanisms in a way that maintains this appearance while increasing system performance. If the period of time is too long, it may stop responding properly. Well, if they are too short, the system will waste too much time switching between them.

Such decisions can be controlled using process priorities, where high-priority processes will run for longer periods of time and at more frequent time slices than low-priority processes.

Multiprocessor Systems (and other variants)

The restrictions described above that only one process can be running at a time do not apply in all situations. It would be more correct to say that one core can only work with one process. Multiprocessor, multicore, or hyperthreaded systems allow multiple processes to run in parallel. However, the same time reduction system is used to handle situations where there are more active processes than available processor cores. This is not unusual: a basic system, even completely idle, almost always has dozens of processes running.

The kernel allows multiple independent instances of the same program to run, but each is only allowed access to its own time slices and memory. This way, their data remains independent.

3.1.4 Rights management

Unix systems support multiple users and groups and allow you to control access rights. In most cases, a process is defined by the user who runs it. A given process can only perform those actions that are authorized by its owner. For example, opening a file requires the kernel to check the process for the necessary rights (for more information on this particular example, see section 3.4.4, “Permission Management”)

3.2 Linux Command Line

By "command line" we mean a text-based interface that allows you to enter commands, execute them, and view the results. You can run a terminal (a text screen inside a graphical desktop, or a text console outside any GUI) and a command interpreter inside it ( shell).

3.2.1

When your system is working correctly, the most in a simple way To gain access to the command line is to launch a terminal in a graphical desktop session.


Figure 3.1 Launching GNOME Terminal

For example, on a default Kali Linux system, GNOME terminal can be launched from the list of favorite applications. You can also enter “terminal” in the Activities window (the window that is activated when you move the mouse to the upper left corner) and click on the application icon you need that appears (Figure 3.1, ““).

In case of any disruption or malfunction of your GUI, you can still launch the command line on virtual consoles (up to six of them can be accessed through six key combinations, starting with CTRL + ALT + F1 and ending with CTRL + ALT + F6 – CTRL key can be omitted if you are already in text mode outside of the GUI Xorg or Wayland).

You get the usual login screen where you enter your username and password before accessing the command prompt with its shell:

The program that processes the data you enter and executes your commands is called shell(shell or command line interpreter). The default shell provided in Kali Linux is Bash(it means Bourne Again Shell). A trailing "$" or "#" character indicates that the shell is waiting for your input. These symbols also indicate how Bash treats you as a regular user (the first case with the dollar sign) or as a superuser (the last case with the hash).

3.2.2

This section provides only a brief overview of some of the commands, each of which has many different options and capabilities not covered here, so please refer to the extensive documentation available in their respective man pages. In penetration testing, most often you will access the system through the shell, after a successful exploit, rather than through a GUI user interface. Knowing how to use the command line competently is essential if you want to succeed as a security professional.

Once the session is started, the pwd command (which stands for print working directory) will display your current location in the file system. Your current location can be changed using the cd command directory name(where cd means (change directory)). In the event that you have not specified the directory where you want to go, you will automatically return to your home directory. If you enter cd -, you will be returned to the previous working directory (the one you were in before you entered the last cd command). The parent directory is always called .. (two dots), while the current directory is called .. (two dots). (one point). The ls command allows you list directory contents. If you do not specify any additional parameters, the ls command will display the contents of the current directory.

You can create a new directory using the mkdir command directory name, and also delete an existing (empty) directory using the rmdir command directory name. The mv command will allow you move and rename files and directories; delete file can be done using rm file name, and copying the file is done using cp source-file target-file.

The shell executes each command by running the first program with the given name that it finds in the directory specified by the environment variable PATH. Most often these programs are located in /bin,/sbin, /usr/bin or /usr/sbin. For example, the ls command is in /bin/ls; Sometimes a command is directly processed by the shell, in which case it is called a shell builtin (among them cd and pwd ); The type command allows you to query the type of each command.

Note the use of the echo command, which simply displays the line in the terminal. In this case, it is used to display the contents of the environment variable, because The shell automatically replaces variables with their values ​​when the command line is executed.

Environment Variables

Environment variables allow you to store global settings for the shell or other programs. They are contextual but inheritable. For example, each process has its own set of environment variables (they are contextual). Shells, such as login shells, can declare variables that will be passed to other executing programs (they are inherited).

These variables can be defined both for the system in /etc/profile and for the user in ~/.profile, but variables that are not specific to command line interpreters are best placed in /etc/environment, since these variables will be introduced into all user sessions thanks to the Pluggable Authentication Module (PAM) – even if no shell is running.

3.3 Linux file system

3.3.1 File system hierarchy standard

Like other Linux distributions, Kali Linux is organized according to the standard FilesystemHierarchy Standard(FHS), allowing users of other Linux distributions to easily navigate Kali. FHS defines the purpose of each directory. Top level directories are described as follows.

  • /bin/: main programs
  • /boot/: The Kali Linux kernel and other files required for its early boot process
  • /dev/: device files
  • /etc/: configuration files
  • /home/: personal user files
  • /lib/: main libraries
  • /media/*: Mount points for removable devices (CD-ROM, USB drives etc.)
  • /mnt/: temporary mount points
  • /opt/: additional applications provided by third parties
  • /root/: administrator's personal files (root files)
  • /run/: non-persistent workflow files that do not persist after reboot (not yet included in FHS)
  • /sbin/: system programs
  • /srv/: data used by servers located on this system
  • /tmp/: temporary files (this directory is often emptied after reboot)
  • /usr/: applications (this directory is further divided into bin, sbin, lib according to the same logic as in the root directory). In addition, /usr/share/ contains data with independent architecture. The /usr/local/ directory is intended to be used by an administrator to install applications manually without overwriting files handled by the packaging system (dpkg).
  • /var/: Variable data processed by the daemon. This includes log files, queues, buffers and caches.
  • /proc/ and /sys/ are specific to the Linux kernel (and are not part of FHS). They are used by the kernel to export data to user space.

3.3.2 User's home directory

The contents of the user directory are not standardized, but there are several conventions worth noting. One is that the user's home directory is often indicated by a tilde (“~”). This is very useful to know because command interpreters automatically replace the tilde with the correct directory (which is in the environment variable HOME and whose normal value is /home/user/ ).

Traditionally, application configuration files are often stored directly in your home directory, but their file names usually start with a dot (for example, email client mutt stores the configuration in ~/.muttrc ). Note that filenames starting with a dot are hidden by default; ls will only list them if the –a option is specified, and graphical file managers must be explicitly configured to show hidden files.

Some programs also use multiple configuration files organized in a single directory (such as ~/.ssh/). Some applications (such as the Firefox web browser) also use their directory to store a cache of downloaded data. This means that these directories can end up consuming a lot of disk space.

These configuration files, which are stored directly in your home directory, are often collectively called dotfiles for a long time expand to such an extent that these directories can become cluttered with them. Fortunately, collaboration under the auspices of FreeDesktop.org led to the creation of the XDG Base Directory Specification, a convention whose purpose is to clean up these files and directories. This specification states that configuration files should be stored in ~/.config , cache files in -/.cache , and application data files in -/.local (or their sub-directories). This convention is gradually gaining momentum.

A graphical desktop most often uses shortcuts to display the contents of the /Desktop/ directory (or any other word that is an exact translation of this, on systems that do not use English). Finally, an email system sometimes stores incoming messages in a directory - /Mail/.

This is interesting:

A good place to start is to have a basic understanding of what Linux is and how it works.

And you can start with Introductions to Linux(sxw). Although there are other introductions. For example this. Here is the document by R.S. Klochkov and N.A. Korshenin Fundamentals of UNIX and Linux (SXW), (PDF).

Fundamentals of UNIX OS. Training course. (SXW) (PDF)
Copyleft (no c) — Fuck copyright! 1999-2003 V. Kravchuk, OpenXS Initiative
This short (estimated to be 16 hours, 6 of which are hands-on) introductory course is designed to introduce you to the architecture, features, and core features of the UNIX operating system. If successfully completed, the course will allow you to work freely and productively in the UNIX OS as a user and continue studying the administration or programming of this operating system.
The presentation is carried out, basically, without reference to the features of any version of UNIX, but if specific details are necessary, it is done for SVR4 systems, in particular, Solaris 8 OS.
I also suggest a book Andrey Robachevsky"UNIX operating system"
Here is what the author writes: “This book is not a replacement for reference books and various manuals on the UNIX operating system. Moreover, the information presented in the book is sometimes difficult to find in the documentation supplied with the operating system. These publications are full of practical recommendations, scrupulous descriptions of the settings of certain subsystems, formats for calling commands, etc. At the same time, issues such as the internal architecture of individual system components, their interaction and operating principles often remain behind the scenes. Without knowledge of this “anatomy,” working in the operating system turns into using memorized commands, and inevitable errors lead to inexplicable consequences. On the other hand, in this book, much less attention is paid to the issues of administering UNIX, configuring specific subsystems and the commands used. The purpose of this book is to outline the basics of organizing an operating room UNIX systems. It should be borne in mind that the name UNIX denotes a significant family of operating systems, each of which has its own name and features unique to it. This book attempts to highlight what is common to the UNIX "genotype", namely: the basic user and program interfaces, the purpose of the main components, their architecture and interaction, and based on this present the system as a whole. At the same time, where relevant, references are made to a specific version of UNIX."

Personally, reading the wonderful book by Viktor Alekseevich Kostromin helps me a lot Linux for the user” which I can offer you (kos1, kos2, kos3, kos4, kos5, kos6, kos7, kos8, kos9, kos10, kos11, kos12, kos13, kos14, kos15, kos16, kos17, kos18).
And here is the same book, but in PDF (kos1, kos2, kos3, kos4, kos5, kos6, kos7, kos8, kos9, kos10, kos11, kos12, kos13, kos14, kos15, kos16, kos17, kos18).
And now also in SXW (kos1, kos2, kos3, kos4, kos5, kos6, kos7, kos8, kos9, kos10, kos11, kos12, kos13, kos14, kos15, kos16, kos17, kos18).
If you prefer documents in HTML format, then using the links above you can get to a page from where you can download archives of book chapters in this format.

Among the fundamental books, I can also recommend the excellent guide by Karl Schroeder "Linux. Collection of recipes". I warn you right away that this link contains the book in .pdf format, and it weighs 50 MB. But an alternative option is also possible - the same book, only in

FORMAT.TXT The abstract for the book is as follows: “The proposed edition contains a unique collection of tips, tools and scenarios; you will find a number of ready-made solutions complex problems problems that any administrator who configures a Linux server encounters; These solutions are useful both when setting up small networks and when creating powerful distributed data storages. The book is written in the already popular form of recipe books published by O’Reilly in the “Problem-Solution-Discussion” format. For experienced users, programmers, system administrators, university students, graduate students and teachers." If suddenly the link ceases to exist, please let me know - perhaps I will post the .pdf file on my website.

I really like the series of articles and notes by Alexey Fedorchuk, Vladimir Popov and a number of other authors, which I take from here: http://unix.ginras.ru/. Here are the most interesting materials about Linux in general and its individual components in particular(Linux-all.zip, Linux-all2.zip, Linux-all3.zip, Linux-all4.zip).
SXW - (Linux-all.zip, Linux-all2.zip, Linux-all3.zip, Linux-all4.zip),
And also a book by Alexey Fedorchuk" The POSIX Saga or Introduction to POSIXism» which covers general issues of a number of systems, primarily UNIX-like ones. The name speaks for itself. According to the authors, the book is intended for users (including beginners). Here are the files - Part 1, Part 2, Part 3, Part 4.
AND SXW— Part1, Part2, Part3, Part4.

And if you are interested in the history of FREE SYSTEMS, you can read the Selection of articles under the general title A road open to everyone"(sxw) and, according to the author, covers general issues of Open Sources, POSIX systems, the history of UNIX, BSD, Linux

Also, to understand the operating principles of the OS, the concept of a process, along with the concept of a file, is, of course, one of the most important concepts. This is the subject of the article by V.A. Kostromina » Processes and Daemons in Linux"(SXW.

Text-Terminal-HOWTO(SXW)v 0.05, June 1998
This document explains what text terminals are, how they work, how to install and configure them, and gives some information about repairing them. It can be somewhat used even if you don't have a terminal manual. Although this work was written for real terminals on Linux system, some of it is also applicable to terminal emulators and/or other Unix-like systems.

It is also very useful to read the beautifully illustrated manual for faster and easier mastering of the console - Working with command history(SXW).

Here are materials devoted to command shells, or command interpreters, also called simply shells. First of all, a selection of articles that are united under the title Shell and utilities(SXW), (PDF).

The most popular shell today is Bash, which is short for Bourne Again SHell. I advise you to read BASH notes, (SXW), (PDF)
Creation date: 12/16/97.

And also Features of the bash shell(SXW), (PDF).
The document briefly summarizes what Bash inherited from the Bourne shell: shell control structures, built-ins, variables, and other features. It also lists the most significant differences between Bash and the Bourne shell.

Shell command language interpreter(SXW), (PDF) - a command language that can execute both commands entered from the terminal and commands stored in a file.

Shell Programming(UNIX) (SXW), (PDF)

If Windows freezes, the user makes certain gestures, and then, convinced of the “futility and vanity of this world,” presses RESET with a calm heart. Things are different in Linux. About this article - Hanging? Let's film it!(SXW)

Questions and answers about kppp(SXW)

Article by V.A. Kostromin “ Hierarchy of directories and file systems in Linux» (SXW), which talks about the standard developed within the Open Source project for the directory structure of UNIX-like operating systems (meaning Linux and BSD systems).

The manual talks about files (which in Linux are essentially directories and even devices), but from a slightly different perspective Files and access rights to them(SXW).
I highly recommend it. Chewed wonderfully.

Linux Commands and Abbreviations(SXW).
This is a practical selection of programs that we use most often, find useful, and that are present in our Linux distributions (RedHat or Mandrake).

UNIX consoles(SXW) – notes on various consoles.

Here's a bad guide Mandrake Linux 9.0 Command Line Guide(SXW).

Mounting file systems from devices and files(SXW) (PDF)
Document creation date: 07/26/2004
Last modified date: 08/20/2004
Author: Knyazev Alexey.

Linux Basics

Linux is inspired by the Unix operating system, which appeared in 1969 and is still in use and development. Much of the internal workings of UNIX exist in Linux, which is key to understanding the fundamentals of the system.

Unix focused primarily on the command line interface, and Linux inherited this. Thus, the graphical user interface with its windows, images and menus is built on top of the main interface - the command line. Additionally, this means that the Linux file system is designed to be easily manageable and accessible from the command line.

Directories and file system

File systems in Linux and Unix are organized according to a hierarchical, tree-like structure. The top level of the file system is / or root directory . This means that all other files and directories (including other drives and partitions) are located inside the root directory. On UNIX and Linux file everything counts - including hard drives, their partitions and removable media.

For example, /home/jebediah/cheeses.odt shows the full path to the cheeses.odt file. The file is located in the jebediah directory, which is located in the home directory, which in turn is located in the root directory (/).

Inside the root directory (/) there are a number of important system directories that are present in most Linux distributions. The following is a list of shared directories that are located directly under the root directory (/):

Access rights

All files in Linux have permissions that allow or deny them to be read, modified, or executed. The super user "root" has access to any file on the system.

Each file has the following three sets of permissions, in order of importance:

    owner

    refers to the user who is the owner of the file

    group

    belongs to the group associated with the file

    other

    applies to all other users of the system

Each of the three sets defines access rights. The rights, and how they are applied to various files and directories, are given below:

    reading

    files can be displayed and opened for reading

    directory contents are available for viewing

    record

    files may be changed or deleted

    the contents of the directories are available for changes

    execution

    executable files can be run as programs

    directories can be opened

To view and edit the permissions on files and directories, open the Applications → Accessories → Home Folder and right-click on a file or directory. Then select Properties. The permissions exist under the Permissions tab and allow for the editing of all permission levels, if you are the owner of the file.

To learn more about file permissions in Linux, read the file permissions page in the Ubuntu Wiki.

Terminals

Working at the command line is not as daunting a task as you would think. There is no special knowledge needed to know how to use the command line. It is a program like everything else. Most things in Linux can be done using the command line, although there are graphical tools for most programs. Sometimes they are just not enough. This is where the command line comes in handy.

The Terminal is located in Applications → Terminal . The terminal is often called the command prompt or the shell. In days gone by, this was the way the user interacted with the computer. However, Linux users have found that the use of the shell can be quicker than a graphical method and still holds some merit today. Here you will learn how to use the terminal.

The terminal was originally used for file management, and indeed it is still used as a file browser if the graphical environment does not work. You can use the terminal as a browser to manage files and undo changes that have been made.

Basic commands

View directory contents: ls

Team ls shows a list of files in different colors with full text formatting

Creating directories: mkdir (directory name)

Team mkdir creates a new directory.

Go to directory: cd (/address/directory)

Team CD allows you to go to any directory you specify.

Copying a file or directory: cp (which is the name of the file or directory) (where is the name of the directory or file)

Team cp copies any selected file. Team cp -r copies any selected directory with all contents.

Removing files or directories: rm (file or folder name)

Team rm deletes any selected file. Team rm -rf deletes any selected directory with all its contents.

Rename a file or directory: mv (file or directory name)

Team mv renames or moves the selected file or directory.

Finding directories and files: locate (directory or file name)

Team locate allows you to find a specified file on your computer. File indexing is used to speed up work. To update the index, enter the command updatedb. It runs automatically every day when the computer is turned on. To run this command, you need super user rights (see “The root user and the sudo command”).

You can also use wildcards to specify more than one file, such as "*" (match all characters) or "?" (match one character).

For a thorough more introduction to the Linux command line, please read the command line introduction on the Ubuntu wiki.

Editing text

All of the configurations and settings in Linux are saved in text files. Even though you most often can edit configurations through the graphical interface, you may occasionally have to edit them by hand. Mousepad is the default Xubuntu text editor, which you can launch by clicking Applications → Accessories → Mousepad on the desktop menu system.

Sometimes, Mousepad launched from the command line using the application gksudo, which runs Mousepad with administrative privileges, which allows you to change configuration files.

If you need a text editor on the command line, you can use nano- easy to use text editor. When running from the command line, always use the following command to disable automatic word wrapping:

Nano-w

For more information about how to use nano, refer to the guide on the wiki.

There are also quite a few other terminal-based editors available in Ubuntu. Popular ones include VIM and Emacs(the pros and cons of each are cause for much friendly debate within the Linux community). These are often more complex to use than nano, but are also more powerful.

root user and sudo command

The root user in GNU/Linux is the user which has administrative access to your system. Normal users do not have this access for security reasons. However, Ubuntu does not enable the root user. Instead, administrative access is given to individual users, who may use the "sudo" application to perform administrative tasks. The first user account you created on your system during installation will, by default, have access to sudo. You can restrict and enable sudo access to users with the Users and Groups application (see “Managing Users and Groups” for more information).

When you open a program that requires super user rights, sudo will require you to enter your password. This will ensure that malicious applications cannot damage your system, and will also remind you that you are about to perform actions that require extra caution!

To use sudo on the command line, simply type "sudo" before the command you want to run. After this you will be required to enter your password.

Sudo will remember your password for 15 minutes (by default). This feature was designed to allow users to perform multiple administrative tasks without being asked for a password each time.

Be careful when doing administrative tasks - you might damage your system!

Some other tips for using sudo include:

    To use the terminal as super user (root), type "sudo -i" at the command line

    The entire suite of default graphical configuration tools in Ubuntu already use sudo, so they will prompt you for your password if needed.

    On startup graphic applications"gksudo" is used instead of "sudo". This allows you to prompt the user for a password in a small graphical window. The "gksudo" command is handy if you want to install a start button Synaptic to your panel or something similar.

    For more information on the sudo program and the absence of a root user in Ubuntu, read the sudo page on the Ubuntu wiki.

Transcript

1 Introduction The course “UNIX OS Fundamentals” is intended for students of initial courses of faculties interested in training software developers of one level or another. A mandatory preliminary course for the UNIX OS is an introductory course in programming in the C language, as a basic course, as well as a course in the basics of computer architecture. The course structure offers 13 lectures and associated laboratory work to help you understand the general principles of operation of an operating system such as UNIX. The lecture material is presented in abstract form, which leaves a greater degree of freedom for the depth of presentation of topics in the lecture material. In addition, the duration of some lectures can vary from 2 to 6 hours, if necessary. Laboratory classes do not require the use of a specialized laboratory or a specific UNIX/Linux clone and can be performed on students’ personal computers using any available UNIX, Solaris, Linux, FreeBSD, Mac OS X, etc. software, provided that the appropriate packages are installed from the repositories for developers. In practice, usually, remote access to a Linux server via the SSH protocol was used to Windows workers stations and PuTTY 1 as an SSH client. Finally, note that all tasks are performed in the shell (bash) and the various existing X Window (X11) interfaces (CDE, GNOME, KDE, Xfwm, Xfce or wmii, etc.) are not discussed here, which allows the use of minimal kernel configurations and concentrate on learning the OS kernel from the very beginning of the course. Why, after all, is Linux chosen to represent the basics of operating systems, and, for example, not Microsoft Windows,? There are several reasons: open source Linux, the UNIX ideology embedded in it, the main OS ideas implemented in UNIX/Linux are also used in Microsoft Windows: multitasking, hierarchical file system, multi-user system, virtual memory, built-in network stack, multithreading, and, most importantly, the Linux kernel - everything often chosen for building computer systems at various levels, from distributed and cloud servers in a corporate system to mobile ones and systems embedded in control chips. 1 Vlasov S.V Faculty of Computer Science VSU, Voronezh 1

2 Lecture 1. Basic concepts. An operating system is a software product designed to manage computer resources: hardware, data, programs and processes. A mandatory component of the OS is the kernel; all other components are applications added to the OS if necessary. For example, when they say: “Linux versions...” they mean the kernel, but by GNU/Linux they mean some clone with a specific kernel and set of applications (Debian, Red Hat, Susse, etc.) The OS kernel is required an OS component that provides the data structures, programs and processes, and hardware-specific code needed to manage the computer's resources. There are different principles for constructing a kernel: a monolithic kernel (Linux) or a microkernel (eg Minix). The kernel can be customized by adding or removing certain components (modules, drivers). A file is a specific sequence of bytes. In UNIX, almost everything is represented as a file. In this case, only 7 types of files are distinguished (the corresponding symbol is indicated in parentheses: in the output of the ls -l command) regular files (-) special files: directory, (d) symbolic link, (l) named pipe, (p) character device, ( c) block device, (b) UNIX socket. (s) Recognizing and processing the internal structure of a file is the responsibility of the application for which the file was intended or created. A hierarchical file system is an abstraction for representing the ordering of files as a tree of directories. The root of the tree is a directory named "/", which is called the root file system (not to be confused with /root). The peculiarity of the Linux hierarchical file system is that it is virtual, in the sense that any node in a single hierarchy can be associated with its own file system of a certain type (ext2fs, ext3fs, riserfs, vfat, etc.), located on a separate device, partition, or directly in memory. The default directory in the hierarchy at any given moment is called the current working directory. You can use absolute file names starting from the root /, or relative names from the current working directory (the "." - dot character) when the parent directory is indicated by ".." characters (two dots horizontally without spaces). A program is a file containing executable instructions. A file containing the printed text of a program in a programming language is called a program source module. Source code written in a script language (shell, perl, python, ruby, etc. ) is executed directly by the language interpreter. Sources in other languages ​​(C, Fortran, etc.) must be compiled to convert the source text into executable software module, containing processor instructions in binary format (evolving from a.out and COFF to ELF). A process is a program at runtime. Processes are also organized into a hierarchy with parent-child relationships. All processes in UNIX have a unique integer identifier (PID). The root process of the hierarchy is process number 1, this is the init process, spawned when the operating system kernel boots and spawns other descendant processes. When the OS is running, any process except init can be stopped. There is also a hidden process 0 - swap, which is responsible for paging virtual memory. Logon process is the parent process for all processes generated by the user Vlasov S.V Faculty of Computer Science VSU, Voronezh 2

3 systems running in multi-user mode. The task of this process is to check the security attributes (login name and password) of the user and start the process that provides the interface for interaction between the OS and the user, usually a shell command language interpreter. A shell interpreter is a program that is part of a specific OS to ensure user interaction with the OS. UNIX/Linux systems use various interpreters: bash, csh, tcsh, ksh, zsh and many others. Bash is usually the default interpreter on GNU/Linux systems. The interpreter provides a command line for launching standard commands and user programs. Vlasov S.V Faculty of Computer Science VSU, Voronezh 3

4 Practical examples. Login via SSH client (PuTTY) In MS Windows, select Start->Run and enter: X:/Putty/Putty.exe In the Putty Configuration window that opens, enter in the field Host Name(or IP address): www2 Clicking on Open will lead to a connection to the www2 server and a logon window will appear in which, when you first try to connect to the Linux server, a PuTTY Security Alert message will appear about the absence of a new RSA key in the registry cache, agree to include the key in the cache for a trusted connection to the server now and in the future. Click Yes. An invitation will appear in the DOS window Vlasov S.V FCS VSU, Voronezh 4

5 Logon as: name password: where you enter your login name (instead of name) and password. Be careful when entering your password, since the keys you press are not displayed in any way when entering, not even asterisks. If everything is done correctly, you will see the shell 2 command line prompt in the same window: ~$ _ Now you can interact with the Linux OS through the command line interface. 3 In what follows, we will only use the $ symbol to indicate the command line, although you may have it preceded by the path to the current working directory. Where are we? (home directory) When registering in the system, each user is assigned a secure home directory for storing personal files. When you log in, the Logon process automatically mounts your home directory as the current working directory. The following three commands should show the same result, the full path to your home directory. $ pwd $ echo ~ $ echo $HOME What do we have? (automatically generated files) The contents of the current working directory can be displayed with the command: $ ls When logging in for the first time, this list is usually empty. 4 However, when a user registers, some hidden service files are created in his home directory, which can be modified by the user to configure the required environment. The -a switch of the ls command allows you to see everything in the list of contents of the current directory hidden files, named with the prefix "." (dot) $ ls -a By the way, this list also includes the anonymous names of the current directory "." and the parent directory "..". By giving your own file a name prefixed with "." (dot) you make it hidden. What system is used? Operations and system configuration options depend on the OS version you are using. To get information about this, use the command $ uname -a Brief information about the parameters and keys of the command can be obtained using the help key, for example, 2 If you have problems connecting to the server or entering your name and password, you have only one option, contact the server system administrator . 3 The $ symbol before the cursor is a command line sign and is the default for a normal user in the bash command interpreter. (The # symbol is used for the root superuser) 4 You may have a public_html directory that can be used to exchange files between Linux and MS Windows systems thanks to the corresponding service. Vlasov S.V Faculty of Computer Science VSU, Voronezh 5

6 $ uname --help Detailed description UNIX commands and functions can be obtained from documentation called man pages (“manual pages” - system manual): $ man pwd $ man ls $ man echo $ man uname Manual pages are presented in a special format nroff /troff/groff and are formatted when output the appropriate utility depending on the type of output device. To finish viewing the manual pages, press the Q key $ man man Manual files are usually stored in packaged form (suffix.gz or .bz2) and are organized into sections: 1. General commands 2. System calls 3. C library functions 4. Special files 5. File formats and conversion 6. Games and screensavers 7. Additional 8. Commands and daemons for system administration The section number is used when referring to the command or function being used, for example, printf/3 and is indicated by the first parameter of the command $ man 1 printf $ man 3 printf The directory in which the command's manual page is located can be determined using the -w $ man -w command Hierarchical File System The ls command can be used to list the contents of any directory in the file system hierarchy (regardless of physical device and the type of file system on the partition or in memory). For example, the root file system is displayed with the command $ ls / However, in order to display the structure of the entire tree, a fair amount of ingenuity is required, for example, $ ls -R grep ":$" sed -e "s/:$//" -e "s/[^-][^\/]*\//--/g" -e "s/^/ /" -e "s/-/ /" where the regular expression filter grep, the stream editor sed and unnamed pipes, indicated by the symbol (pipe). In your home directory, you can create a new (empty) directory node in the hierarchy, for example, lab1 Vlasov S.V Faculty of Computer Science VSU, Voronezh 6

7 $ mkdir lab1 Any node in the hierarchy can be selected as the current one $ cd lab1 $ pwd To return to your home directory (defined by the HOME environment variable), use the cd command without parameters $ cd $ pwd You can delete an empty directory with the rmdir command, for example, $ rmdir lab1 If the directory is not empty, then the last command (if lab1 contains some files) will display the messages rmdir: lab1: Directory not empty and the deletion will not be performed. In the current directory you can create, for example, a text (regular) file. To do this, you can use the redirected output of the command echo $ echo "echo Print directory tree " > tree A tree file is created, the contents of which can be output with the command $ cat tree or in page formatted form $ pr tree You can even add a new line to the end of the existing file, for example, $ echo using grep and sed >> tree $ cat tree You can use a line text editor ed a standard editor designed for editing text from a typewriter-type console. $ ed tree a ls -R grep ":$" sed -e "s/:$//" -e "s/[^-][^\/]*\//--/g" -e "s /^/ /" -e "s/-/ /". wq $ cat tree We have actually created a command file here that can be executed like new team, if you declare it “executable”: $ chmod +x tree $./tree Vlasov S.V Faculty of Computer Science VSU, Voronezh 7

8 Note that an attempt to execute a file without specifying the current directory, i.e. just tree rather than ./tree as shown above will not result in the file being found in the current directory. This is because, for security reasons, the anonymous current directory is not included in the PATH environment variable, which is used to find a program to run by name. $ echo $PATH The user can get a complete list of environment variables and their values ​​with the command: $ env To create text files, you can also use the cat command with redirection of the output to a file $ cat > file text Ctrl-D Here, pressing the Ctrl-D keys transmits to the input stream end of file (EOF) symbol END OF TRANSMISSION. You can also append text to the end of the file $ cat >> file appended text Ctrl-D To create large text files, for example with C sources, use powerful on-screen text editors such as vi/vim, nano or emacs. Deleting a file is done with the command $ rm file. Among other things, the -r or -R switch allows you to recursively delete a subtree of directories. To safely delete files, it is recommended to use the -i switch, which generates a request to confirm the deletion. Moving and renaming a file is carried out with the command Date and time $ mv old new The current system time and date can be determined with the command $ date To change the time and/or date, use a parameter in the MMDDhhmmYY format. For example, for a job on January 24 8:36 PM 2011, you would enter $ date. Note also that the time command found on UNIX systems shows the time used by the following process ( real time, user-mode execution time, and kernel-mode time), rather than the current system time. Try Vlasov S.V FCS VSU, Voronezh 8

9 $ time date you should get something like the following output real user sys 0m0.040s 0m0.000s 0m0.040s Who else is on the system? UNIX OS is a multi-user system that allows you to simultaneously execute a logon process and allow several users to work in the system independently of each other. To determine who is currently logged in, use the $who command, which displays the user's login name, terminal, and the time the logon process was initiated. In a multi-user system, the same user can use several different terminals at the same time (for example, several parallel SSH sessions). To determine who is using the current terminal, you can use the command $ whoami Registered users So, to use the system you need to be a registered user. Registration is carried out by the system administrator with superuser rights, which has a standard name in UNIX/Linux systems - root. 5 Typically, all registration records about users are stored in a single file /etc/passwd, which is readable by everyone $ cat /etc/passwd In earlier versions of the system, the encrypted password (hash) of the user was also stored in the same file (the second field after the user name , separated by a colon). But in newer systems, it is common practice to store password hashes in another file /etc/shadow, which cannot be read by anyone other than root. The password field in the /etc/passwd file stores only a hidden link to the entry in /etc/shadow, so only the “*” character is displayed. To change the current password on UNIX systems, use the command $ passwd Changing password for name. (current) UNIX password: current user password new UNIX zfyytsschkv: New Password retype new UNIX password: new password (again exactly the same as in the previous line) passwd: password updated successfully If there is an error or the password is too simple, messages appear, for example, or passwd: Authentication token manipulation error BAD PASSWORD: it is too simple simplistic /systematic 5 Typically, the root name is not used to log in to the system; instead, the administrator creates a normal login for himself, but uses the su command to perform operations that require superuser privileges. In Linux systems, a popular group of privileged users is sudoers, who receive the right to perform operations with root rights through the sudo command Vlasov S.V Faculty of Computer Science VSU, Voronezh 9

10 In this case, you must enter a different password. Note that the passwd process runs in special superuser mode and ignores the SIGINT signal sent by pressing Ctrl-C and thus cannot be interrupted. A simple way of communication Users simultaneously working in the system can send short messages to each other using the command $ write name The user with the specified name/terminal will immediately receive a notification Message from your_name on tty0 at 10:30.. and if you continue to type on your terminal (here on tty0), the message will immediately appear line by line on the terminal of the user with the name specified in the command. To end the message you must enter Ctrl-D. However, if your opponent does not want to receive any messages, then he uses the $ mesg n command to disable the ability to send/receive write messages. To enable this feature, the user must run the command $ mesg y If you need to send a message to all users on the system at once (who have messages enabled), you can use the command $ wall message up to 20 lines Ctrl-D Log off the session $ logout You can also use Ctrl-D or $ exit The logout command may not terminate the session, but will display one of two messages or There are stopped jobs not login shell: use "exit" The first message is a warning that your session has been started and paused (by the SIGSTOP signal or Ctrl- Z) tasks. You have the opportunity to continue executing jobs (with the jobs and fg commands) until they complete normally. However, if you do not do this, suspended jobs will be terminated (with a SIGTERM signal) when the logout or Ctrl-D command is executed again. The second message means that you have spawned child processes from the shell launched by the logon process that are executing the current shell session that is not associated with the logon process. Vlasov S.V Faculty of Computer Science VSU, Voronezh 10

11 You must execute the exit or Ctrl-D command in the current shell to return to the shell process spawned by logon. Conclusions The OS is a complex software system consisting of subsystems for managing various resources. The purpose of the course is to study the main features of the functioning of the UNIX/Linux OS kernel subsystems through the system call interface. Vlasov S.V Faculty of Computer Science VSU, Voronezh 11


MINISTRY OF EDUCATION AND SCIENCE OF THE RF FEDERAL STATE BUDGETARY EDUCATIONAL INSTITUTION OF HIGHER PROFESSIONAL EDUCATION “Kama State Engineering and Economic Academy” MANAGEMENT

6.31. Cycles. Shift parameters. for variable in values ​​do statements done for var1 in value1 value2 value3 do echo $var1 done for File1 in $(ls *.sh); do echo $File1 >> All.txt done while do condition

Information Technology Lecture 3 1 Bash shell 2 Basic information Shell or shell working in text mode (command line interface) Graphical user interface (GUI) working in graphical mode

SHELL Definition: Shell [shell] interpreter of operating system commands. Shells are divided into two types, depending on the organization of work with the user: - command line interpreter; - graphic

2 Navigation The first thing we will try to learn (after trial keystrokes) is navigation in the Linux file system. In this chapter, we will introduce the following commands into everyday use: pwd displays the name of the current worker

SibGUTI Department of High-Level Language Programming (HLL), semester 1 2009 2010 academic year Polyakov A.Yu. Laboratory work 1. Linux OS programming environment. Purpose of work: To get acquainted with the software

Lecture 2. Process control subsystem. Process management in a multitasking system consists of allocating kernel resources for each running process, performing process context switching

MOSCOW STATE TECHNICAL UNIVERSITY named after. N.E. BAUMAN Faculty of “Informatics and Control Systems” Department of “Automated Information Processing and Control Systems” Syomkin P.S., Syomkin

Working with the GNU/Linux OS in terminal classes of the Department of Armed Forces. Purpose of the work: to get acquainted with the GNU/Linux OS software and write a simple program in C language. Operating system (OS) GNU/Linux

BOINC system. The lesson is conducted by: Khrapov Nikolay Pavlovich Institute of Information Transmission Problems RAS Practical lesson Basics of working with the OS Linux Installation BOINC servers Practical lesson Basics of work

OS components Main OS components 1. Process management 2. Main memory management 3. File management 4. I/O system management 5. External memory management 6. Networking support

Introduction to the Linux command line How to stop worrying and love the shell Alexey Sergushichev Practical school in bioinformatics MNL "Computer Technologies" 02/19/2014 Command line Command line

Linux operating system Lecture 6 The command shell (shell, bash) is a command line interface in Unix-like operating systems, that is, it executes commands that the user issues or that are read

Laboratory work 4 INTRODUCTION TO PROCESSES Purpose of the work To become familiar with the concept of process. Learn to get a list of processes available in the system and manage their state. 1. Theoretical information

Filename patterns, file search and other UNIX features Registering in Linux Run putty.exe Enter the IP address Click Open Username studentx Password studentx 2 Create a directory

Contents Preface 6 Lecture 1. Working session in Linux 8 1.1 System users................................ 8 1.2 Registration in the system..... .................. 13 1.3 Simultaneous access to the system..................

The basics of the vast world of the UNIX system are outlined in an accessible way for the non-professional user. The user gradually learns to log into the system, use various commands, ask for help, find

Working with standard document templates Cognitive Technologies User's Guide Moscow, 2015 2 ABSTRACT This document provides information about the use of the E1 Euphrates software package

Computer science Information technology Lecture 1. Introduction to the Linux OS Main characteristics of Linux Real multitasking Multi-user access Swaping RAM to disk Page

Other languages: English Russian iridium Server for Raspberry Pi Installing and configuring the server in the i3 lite project iridium Sever for Raspberry Pi is a software implementation of iridium Server that runs

FEDERAL AGENCY FOR EDUCATION Tomsk Polytechnic University APPROVED by: Dean of AVTF Gaivoronsky S.A. 2009 SIMPLE SHELL TOOLS Guidelines for performing laboratory work

Lesson 3. Topic: Accounts in Linux. Type of lesson: lecture, practical lesson. Study questions: 1. Concept of account and authentication. Files /etc/passwd and /etc/group, /etc/shadow and /etc/gshadow.

Abstract of the program of the discipline "Operating Systems" 1. Goals of mastering the discipline The goals of mastering the discipline "Operating Systems" are: developing in students basic knowledge, skills and abilities in

Laboratory work 2. Navigation through the file structure and its maintenance using the Xubuntu OS terminal Practical part II. Navigation through the file structure and its maintenance using the OS terminal

Page 1 of 7 News Technical equipment of a Linux cluster Resource usage statistics Registration on a Linux cluster Registration on SPP-2000 AFS file system Network security issues Libraries

Basic concepts and definitions Operating system (hereinafter referred to as OS) is a software package that controls the functioning of a computer and ensures the interaction of devices included in it

Chapter 1 Choosing an Operating System The fact that you are reading this book means that you want to learn Linux. Before you start this journey, you must understand what an operating system is

Practical work 10 Working with files in LINUX Purpose of the work: to study the features of working with files in the Linux operating system. Work plan: 1. Familiarize yourself with brief theoretical information.

APPROVED BY -LU INFORMATION PROTECTION SYSTEM AGAINST UNAUTHORIZED ACCESS Dallas Lock Linux Operator (User) Manual Sheets 11 2016 2 Abstract This operator manual is distributed

Information technology Lecture 2 Linux Commands 2 Commands Linux Commands Linux consoles- interaction between the user and the OS Executed through the command line by manually entering Behind each command

Software and hardware complex of trusted download "Blokhost-MDZ" Installation guide for the software package "Blokhost-MDZ". Installation Guide. Page 2 Abstract The document describes the installation

Multifunctional hardware and software complex for the provision of communication services "IS RINO" Basic software Management server CONTENTS 1 INTRODUCTION... 3 2 COMPOSITION OF THE SOFTWARE... 3 3 INSTALLING THE SERVER...

Rutoken Logon. Administrator's Guide 2018 Aktiv Company In this document This document contains answers to the following questions: What is the Rutoken Logon software product used for? (see page

Contents of the lesson Terminology Remote access tools Login 1 User (user) user, account(account). Object for recording system actions. Login 1. Username/account

Tasks Part 1: Running FTP from the Command Line Part 2: Uploading an FTP File Using the WS_FTP LE Client Part 3: Running FTP in a Browser Input/Script FTP (File Transfer Protocol) included in the kit

The general principles of organization, composition, structure of operating systems and their shells, as well as a number of specific systems are considered. Considerable attention is paid to the problems of information and process management

And setting up a network operating system FreeBSD systems FreeBSD FreeBSD is a modern operating system for servers, desktops and embedded computing platforms. FreeBSD provides modern networking

LLC "Company "ALS and TEK" Software of the ALS-24000 switch family, ver. 6.01 Installation guide Sheets 13 2017 2 1. GENERAL INFORMATION 3 1.1. Purpose and scope 3 2. COMPUTER REQUIREMENTS

IV. METHODOLOGICAL INSTRUCTIONS FOR ORGANIZING INDEPENDENT WORK OF STUDENTS WHILE STUDYING THE DISCIPLINE “OPERATING SYSTEMS” Name of the discipline section 1. Evolution of operating systems. Purpose

Operating system The operating system is the most important program. The operating system is a set of programs that ensure the interaction of all hardware and software parts of the computer with each other and

4 Laboratory work 1. Installation and configuration of the operating system on a virtual machine 1.1. Purpose of the work The purpose of this work is to acquire practical skills in installing an operating system

Federal state budget educational institution higher professional education "National Research Tomsk Polytechnic University" APPROVED by: Head of Academic

Laboratory work 1. Navigation through the file structure and its maintenance using the Windows command line interpreter Theoretical part. Directory is a special kind of file containing the names of subdirectories

Operating system Software The operating system is the most important program The operating system is a set of programs that ensure the interaction of all hardware and software parts

Licensing and protection system for platform configurations 1C:Enterprise 8, version 3.0 Administrator's Guide Supported operating systems... 1 System composition... 1 SLK Server... 1 External component...

Introduction Working with the GNU/Linux operating system Currently, the main interface between the user and the desktop operating system is the Graphical User Interface (Graphic User Interface).

PRACTICAL WORK 2 Command line OS Windows Purpose of work: to study the command line interface of Windows OS, acquire skills in solving typical tasks of administering the Windows operating system using

Laboratory work 2 Managing files in the operating system Goals and objectives of laboratory work: obtaining skills in working with an operating system such as Linux; learning the basics of operating room management

CONNECTION MANAGER FOR VIRTUAL WORKSTATIONS TERMIDESK ADMINISTRATOR'S MANUAL (preparing a basic workstation) 23811505.6200.001.I5.01-2 Sheets 17 MOSCOW 2018 1 CONTENTS 1 INTRODUCTION...4 1.1

Federal State Budgetary Institution of Higher Professional Education "SibGUTI" Department computing systems Disciplines "PROGRAMMING LANGUAGES" "PROGRAMMING" Practical lesson 55 OS GNU/Linux Teacher: Associate Professor of the Department of Armed Forces, Ph.D. Polyakov Artem Yurievich

Appendix WORK PROGRAM OF THE ACADEMIC DISCIPLINE OPERATING SYSTEMS AND ENVIRONMENTS Work program academic discipline Operating systems and environments developed on the basis of the Federal State Educational

2.1. Files. Requirements for information storage: the ability to store large volumes of data; information must be retained after the process is terminated; several processes must have simultaneous

Programming languages ​​and translation methods Presentation for laboratory work 2 Operating room Windows system Contents 2 Contents 3 Concept of operating system Operating system (OS) basic software

Installing IBM DB2 v11.1 server on Linux Installing IBM DB2 using the installation wizard requires that you have the graphical interface installed and running, including the X-Window base packages,

1.1 History of the OS The first (1945-1955) computers worked without operating systems; as a rule, they ran one program. When the speed of program execution and their number began to increase, downtime

Managing Rutoken drivers using group policies 2017 Aktiv Company In this document This document describes how to use group policies for automatic kit distribution

Topic: Purpose: Practical work 23. Basics of working in Ubuntu. Get acquainted with the Ubuntu OS interface, learn how to work with files and directories, launch programs, view text and graphics

Secret Net information security tool Instructions for local updating of the Secret Net client This document contains a detailed description of the sequence of actions for local updating of the client

About the Authors 15 Introduction 17 Book Structure 18 From the Publisher 20 Chapter 1: Basics at a Glance 21 Some Basic Commands 21 Displaying Date and Time: The Date Command 21 Finding Registered Users

HV Manager User Guide 2017 AprilTech, llc. All rights reserved 1 CONTENTS Introduction... 3 Installation and configuration... 4 System Requirements... 4 Installation... 5 Configuration... 6 Settings

1 Lab 3 “DATA STREAM REDIRECTING” Streams and Files Logically, all files in a Linux system are organized into a continuous stream of bytes. Any file can be freely copied and added to another

UNIX(Unix, Unix) - a group of portable, multitasking and multi-user operating systems. The first Unix operating system was developed in the late 1960s and early 1970s by the American research firm Bell Laboratories. Initially it was focused on minicomputers, and then began to be used on computers of all classes, including mainframes and microcomputers. This was facilitated by the adaptation of Unix to 32-bit microprocessors from Intel, which was carried out in 1990. The functionality and flexibility of Unix ensured its use in heterogeneous automated systems, as well as the creation of dozens of standards for computer manufacturers. Operating systems of the Unix family:

Linux is a version of the Unix operating system for computing platforms based on Intel processors;
HP-UX - Hewlett-Packard version; is constantly evolving and is compatible with IE-64, which is a new standard for 64-bit architecture;
SGI Irix is ​​a Silicon Graphics PC operating system based on System V Release 3.2 with BSD elements. On this version of Unix, the Industrial Light & Magic studio created the films “Terminator 2” and “Jurassic Park”.
SCO Unix - Santa Cruz Operation version for the Intel platform, independent of hardware manufacturers;
IBM AIX - implemented based on System V Release 2 with some BSD extensions;
DEC Unix is ​​an operating system with support for clusters; designed to work together with Windows NT;
NeXTStep-4.3 BSD - OS based on the Mach kernel, used in NeXT computers; belongs to Apple Computer and serves as an operating system for Macintosh computers;
Sun Solaris is an operating system for SPARC stations based on System V Release 4 with numerous additions.

The Unix operating system appeared during the development of minicomputers. In 1969, the research firm Bell Labs began developing a compact operating system for Digital Equipment Corporation's 18-bit DEC PDP-7 minicomputer. The system was originally written in assembly language and the birth date of Unix is ​​considered to be January 1, 1970. In 1973, it was rewritten in the C language, which was developed at Bell Labs. At the same time, the official presentation of the operating system took place. Its authors, Bell Labs employees Ken Thompson and Dennis M. Ritchie, called their brainchild a “universal time-sharing OS.”

Unix was based on a hierarchical file system. Each process was treated as a sequential execution program code within the autonomous address space, and working with devices was treated as working with files. The first version implemented the key concept of a process, later system calls (fork, wait, exec, exit) appeared. In 1972, pipelining was introduced through the introduction of pipes.

By the end of the 1970s, Unix had become a popular operating system, helped by preferential distribution conditions in the university environment. Unix was ported to many hardware platforms, and its variants began to appear. Over time, Unix became the standard not only for professional workstations, but also for large enterprise systems. The reliability and flexibility of UNIX settings has made it popular, especially among system administrators. She played an active role in the spread of global networks, and, above all, the Internet.

Thanks to the source disclosure policy, numerous free dialects of Unix running on Intel platform x86 (Linux, FreeBSD, NetBSD, OpenBSD). Full control over texts made it possible to create systems with special performance and security requirements. Unix also assimilated elements of other operating systems, resulting in the development software interfaces POSIX, X/Open.

There are two independently developed branches of UNIX - System V and Berkeley, on the basis of which Unix dialects and Unix-like systems are formed. BSD 1.0, which became the basis for non-commercial UNIX dialects, was released in 1977 at the University of California, Berkeley, based on the UNIX V6 source code. In 1982-1983, the Unix System Laboratories (USL) released the first commercial dialects of Unix, System III and System V. The System V version of Unix formed the basis for most subsequent commercial variants. In 1993, AT&T sold the rights to Unix along with the USL laboratory to Novell, which developed a UNKWare dialect based on System V, owned by the Santa Cruz Operation under the name SCO UNIXWare. The Unix trademark is owned by the X/Open Company.

Unix gained popularity due to its ability to work on different hardware platforms - portability, or mobility. The mobility problem in UNIX was solved by unifying the operating system architecture and using a single language environment. The C language developed at Bell Labs became the link between the hardware platform and the operating environment.

Many portability problems in Unix were solved by providing a single software and user interface. Two organizations are tackling the problem of reconciling multiple Unix dialects: the IEEE Portable Applications Standards Committee (PASC) and the X/Open Company (The Open Group). These organizations are developing standards that make it possible to integrate heterogeneous operating systems, including those not related to Unix (IEEE PASC - POSIX 1003, X/Open - Common API). Thus, POSIX-compatible systems are Open-VMS, Windows NT, OS/2.

The portability of Unix, as a system oriented to a wide range of hardware platforms, is based on a modular structure with a central kernel. Initially, the UNIX kernel contained a set of tools responsible for process dispatching, memory allocation, working with the file system, and driver support external devices, networking and security tools.

Subsequently, by separating the minimum required set of tools from the traditional kernel, a microkernel was formed. The most famous implementations of Unix microkernels are Amoeba, Chorus (Sun Microsystems), QNX (QNX Software Systems). The Chorus microkernel occupies 60 KB, QNX - 8 KB. Based on QNX, a 30 KB POSIX-compliant Neutrino microkernel was developed. At Carnegie Mellon University in 1985, the Mach microkernel was developed, used in NeXT OS (NeXT), MachTen (Mac), OS/2, AIX (for IBM RS/6000), OSF/1, Digital UNIX (for Alpha), Windows NT, BeOS.

In Russia, the Unix operating system is used as a network technology and operating environment for various computer platforms. The infrastructure of the Russian Internet was formed on the basis of Unix. Since the early 1980s, domestic work on the Unix operating system was carried out at the Institute of Atomic Energy named after. I. V. Kurchatov (KIAE) and the Institute of Applied Cybernetics of the Ministry of Automotive Industry. The result of the unification of these teams was the birth of the DEMOS operating system (Dialogue Unified Mobile Operating System), which, in addition to domestic analogues of the PDP-11 (SM-4, SM-1420), was transferred to the ES Computer and Elbrus. Despite its versatility, Unix lost the market personal computers Microsoft's Windows family. The Unix operating system maintains its position in the field of mission-critical systems with a high degree of scalability and fault tolerance.

Share