Unix basics. Linux Basics - Command Line and File System. Directories and file system

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 labs to help you understand general principles functioning of a UNIX operating system. 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 exercises do not require the use of a specialized laboratory or a specific UNIX/Linux clone and can be performed on personal computers students using any available UNIX, Solaris, Linux, FreeBSD, Mac OS X, etc. software, provided that the appropriate packages are installed from the developer repositories. 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: the open source of Linux, the UNIX ideology embedded in it, the basic ideas of the OS implemented in UNIX/Linux are also used in Microsoft Windows: multitasking, hierarchical file system, multi-user system, virtual memory, built-in network stack, multi-threading, and, most importantly, Linux kernel increasingly chosen for construction computer systems various levels from distributed and cloud servers in a corporate system to mobile, and systems embedded in control chips. 1 Vlasov S.V Faculty of Computer Science VSU, Voronezh 1

2 Lecture 1. Basic concepts. OS operating system is software, 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 some 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 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. The 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 for conversion source text to 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 operating 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 an interpreter command language shell. 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 Host Name (or IP address) field: www2 Clicking on Open will lead to connection to the www2 server and a logon window appears, in which, when you first try to connect to Linux server a PuTTY Security Alert message will appear indicating that a new one is missing from the registry cache. RSA key agree to include the key in a 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, then you will see the command line prompt of the shell 2 interpreter 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 himself 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 switches 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 system administrator server. 3 The $ symbol before the cursor is a command line sign and is the default for regular user in the bash shell. (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 descriptions of UNIX commands and functions can be obtained from documentation called man pages (“manual pages”): $ man pwd $ man ls $ man echo $ man uname Manual pages are presented in a special format nroff /troff/groff and are formatted when output by 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 screen savers 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 the physical device and 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 grep regular expression filter is used, streaming sed editor 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 at the end existing file eg $ 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 In fact, we have created a file with commands here, which can be executed as a new command 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 Full list The user can get environment variables and their values ​​with the command: $ env To create text files you can also use the cat command to redirect the output to a file $ cat > file text Ctrl-D Here, pressing Ctrl-D sends the end of file (EOF) character END OF TRANSMISSION to the input stream. 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 the latest systems It is customary to store password hashes in another file /etc/shadow, which is not readable 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 On error, or too simple password messages appear, for example, or passwd: Authentication token manipulation error BAD PASSWORD: it is too simple simplistic/systematic 5 Usually, the root name is not used to log in to the system; instead, the administrator creates a regular one for himself registration record, 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 via the sudo command Vlasov S.V FCS 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 transmit to each other short messages 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 typing on your terminal (here on tty0), the message will immediately appear line by line on terminal from 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 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 interface system calls. 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 VS Programming in Language high level(PYAVU), 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 and switching the context of processes

MOSCOW STATE TECHNICAL UNIVERSITY named after. N.E. BAUMAN Faculty of “Informatics and Control Systems” Department “ Automated systems information processing and management" 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 to write the simplest program in C language. Operating system (OS) GNU/Linux

BOINC system. The lesson is conducted by: Nikolay Pavlovich Khrapov Institute of Information Transmission Problems RAS Practical lesson OS Basics 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. Management external memory 6. Networking support

Introduction to command Linux string How to stop worrying and love the shell Alexey Sergushichev Practical school in bioinformatics MNL " Computer techologies» 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 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 random access memory 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 PRODUCTS Guidelines to perform laboratory work

Lesson 3. Topic: Accounts in Linux. Type of lesson: lecture, practical lesson. Study questions: 1. Concept of account and authentication. The 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) software package, which controls the functioning of the computer and ensures the interaction of the 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

Lesson content Terminology Tools remote access Login 1 User (user) user, Account(account). An 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 FreeBSD FreeBSD is a modern operating system for servers, desktops and embedded computer 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 main program An operating system is a set of programs that ensure the interaction of all hardware and software parts of a computer with each other and

4 Laboratory work 1. Installation and configuration of the operating system on 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 vocational 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 file special type 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 operating system GNU/Linux Currently, the main interface between the user and the desktop operating system is the Graphical User Interface (Graphic

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 Working programm 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 an IBM DB2 v11.1 server on Linux To install IBM DB2 using the installation wizard, you must have an installed and running GUI, including basic X-Window 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 Structure of the book 18 From the publisher 20 Chapter 1. Short review Basics 21 Some basic commands 21 Displaying the date and time: 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 REDIRECTION” 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

In 1965, Bell Telephone Laboratories (a division of AT&T), together with penal operator and the Massachusetts Institute of Technology (rIT), began to develop a new operating system called rULTIqS (rULTipleoed Information and Computing Service). The project participants had the goal of creating a multitasking time-sharing operating system capable of supporting the work of several hundred users. From Bell Labs, two participants took part in the project: Ken Thompson and Dennis Ritchie. Although the rULTIqS system was never completed (Bell Labs withdrew from the project in 1969), it became the forerunner of the operating system that later became known as Unio.

However, Thompson, Ritchie and a number of other employees continued to work on creating a convenient programming system. Using ideas and developments that emerged from work on rULTIqS, they created a small operating system in 1969 that included a file system, a process management subsystem, and a small set of utilities. The system was written in assembler and used on the nDn-7 computer. This operating system was named UNIX, a name similar to rULTIqS and coined by another member of the development team, Brian Kernigan.

Although early version UNIX had a lot of promise; it couldn't reach its full potential without being used in some real project. And such a project was found. When Bell Labs' patent department needed a word processing system in 1971, UNIX was chosen as the operating system. By that time, it had been transferred to the more powerful nDn-11, and it had grown a little. 16K was occupied by the system itself, 8K was allocated to application programs, maximum size The file was set to 64K with 512K disk space.

Shortly after the first assembly versions were created, Thomson began working on a compiler for the FxuTuAN language, and as a result he developed Language B. This was an interpreter with all the limitations of an interpreter, and Ritchie developed it into another language, called q, which allowed the generation of machine code. In 1973, the operating system kernel was rewritten in the high-level language C, a previously unheard of move that had a huge impact on the popularity of UNIX. This meant that a UNIX system could now be ported to other hardware platforms in a matter of months and making changes was not particularly difficult. The number of running UNIX systems at Bell Labs exceeded 25, and the UNIX Sgstem Proup (USp) group was formed to maintain UNIX.

Research versions (AT&T Bell Labs)

In accordance with US federal law, AT&T did not have the right to commercially distribute UNIX and used it for its own needs, but starting in 1974, the operating system began to be transferred to universities for educational purposes.

The operating system has been modernized, each a new version was supplied with the corresponding edition of the Programmer's Guide, from which the versions themselves received the name editions (jdition). A total of 10 editions were released from 1971 to 1989. The most important editions are listed below.

Revision 1 (1971)

The first version of UNIX written in assembly language for nDn-11. Included the B language and many well-known commands and utilities, including cat, chdir, chmod, cp, ed, find, mail, mkdir, mkfs, mount, mv, rm, rmdir, wc, who. Primarily used as a word processing tool for the Bell Labs patent department.

Revision 3 (1973)

The ss command appeared in the system, launching the C language compiler. Number installed systems reached 16.

Revision 4 (1973)

The first system in which the kernel is written in the high-level language C.

Revision 6 (1975)

First version of UNIX available outside of Bell Labs. The system was completely rewritten in C. Since that time, new versions began to appear that were not developed at Bell Labs and the popularity of UNIX began to grow. This version of the system was installed at the University of California at Berkeley, and the first version of BSD (Berheleg Softkare Distributuion) UNIX was soon released on its basis.

Revision 7 (1979)

Included the Bourne Shell command interpreter and a C compiler from Kernighan and Ritchie. The core of the system has been rewritten for portability to other platforms. The license for this version was purchased by ricrosoft, which developed the XjNIX operating system based on it.

UNIX grew in popularity, and by 1977 the number of operating systems exceeded 500. That same year, the system was ported to a non-nDn computer for the first time.

UNIX genealogy

There is no standard UNIX system; all UNIX-like systems have features and capabilities that are unique to them. But for different names and the features are still easy to notice - the architecture, user interface and programming environment of UNIX. The explanation is quite simple: all these operating systems are close or distant relatives. The most prominent representatives of this family are described below.

System III (1982)

Not wanting to lose the initiative to develop UNIX, AT&T in 1982 merged several existing versions of the OS and created a version called Sgstem III.

This version was intended for distribution outside of Bell Labs and AT&T, and marked the beginning of a powerful branch of UNIX that is still alive and growing today.

System V (1983)

In 1983, System V was released, and later several more releases for it:

  • SVR2 (1984): InterProcess Communication (IPC) shared memory, semaphores
  • SVR3 (1987): I/O Streams System, File System Switch, shared libraries
  • SVR4 (1989): NFS, FFS, BSD sockets. SVR4 combines the capabilities of several well-known versions of UNIX - SunOS, BSD UNIX and previous releases of System V.

Many components of this system were supported by ANSI, POSIX, X/Open and SVID standards.

UNIX BSD (1978) (Based on UNIX 6th edition)

  • 1981, by order of DAunA, the Tqn/In stack was built into BSD UNIX (in 4.2BSD)
  • 1983 actively used network technologies and could connect to the ARPANET network
  • 1986 version 4.3BSD released
  • 1993 4.4BSD and BSD Lite (last released versions) released.

OSF/1 (1988) (Open Software Foundation)

In 1988, IBM, DEC, HP teamed up to create a version of UNIX independent of AT&T and SUN and created an organization called OSF. The result of the activities of this organization was the OSF/1 operating system.

Standards

The more different variants of UNIX appeared, the more obvious the need to standardize the system became. Having standards makes applications easier to port and protects both users and manufacturers. As a result, several standardization organizations emerged and a number of standards were developed that influenced the development of UNIX.

IEEE POSIX (Institute of Electrical and Electronics Engineers Portable Operating System Interface)

  • 1003.1 (1988) API (Application Programming Interface) OC standardization
  • 1003.2 (1992) definition of shell and utilities
  • 1003.1b (1993) Real-time Application API
  • 1003.1c (1995) definitions of “threads”

ANSI (American National Standards Institute)

  • Standard X3.159 (1989)
  • Syntax and semantics of the C language
  • Content standard library libc

X/Open

  • 1992 Xwindow standard
  • 1996 creation, together with OSF, of the CDE (Common Desktop Environment) user interface and its interface with the Motiff graphical shell

SVID (System V Interface Definition)

Describes the external interfaces of UNIX versions of System V. In addition to SVID, SVVS (System V Verification Suite) was released - a set of text programs that allows you to determine whether a system complies with the SVID standard and whether it is worthy of bearing the proud name System V.

Known versions of UNIX

  • IBM AIX based on SVR2 with many features of SVR4, BSD, OSF/1
  • HP-UX version of HP
  • IRIX version of Silicon Graphics, similar to SVR4
  • Digital UNIX version of DEC based on OSF/1
  • SCO UNIX (1988) one of the first UNIX systems for PC developed based on SVR3.2
  • Solaris version of UNIX SVR4 from Sun Microsystems

Linux Basics

Linux is inspired by the Unix operating system, which appeared in 1969 and is still in use and development. Much of internal device UNIX also exists in Linux, which is key to understanding the basics 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 disks, 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

    performance

    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 file or directory name) (where is the directory or file name)

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. Permissions are required to run this command super user(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 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.



2024 wisemotors.ru. How it works. Iron. Mining. Cryptocurrency.