05 Operating System Basics
05 Operating System Basics
Foreword
The operating system (OS) plays an important role in the interaction
between the user and the computer. But what exactly is an OS?
What are the types of OSs? What are the basic commands of the
Linux system? This course explores these questions, and more, to
help you better understand OSs.
2 Huawei Confidential
Objectives
Upon completion of this course, you will understand:
The definition and components of OSs.
Different types of OSs.
Basic Linux operations.
3 Huawei Confidential
Contents
2. Linux Basics
4 Huawei Confidential
Operating System Definition and Functions
An operating system (OS) is a computer program (system software) that manages
and controls computer hardware and software resources.
User
Core functions:
Application
System call interface
software
Process management
Memory management
Operating
system
File system
management
Hardware
Driver management
5 Huawei Confidential
Contents
2. Linux Basics
6 Huawei Confidential
Components of an Operating System
From the perspective of users, an OS consists of a kernel and various applications, that is, the kernel
space and user space.
The user space is where upper-layer applications run.
The kernel is essentially a software program used to manage computer hardware resources and provide
a system call interface to run upper-layer application programs.
Applicatio
ns and
shells
Function
libraries
System
Calls
Kernel
7 Huawei Confidential
Contents
2. Linux Basics
9 Huawei Confidential
Common Server OSs
Common Unix OSs:
A multi-user and multi-process OS. It supports large-scale
HP-UX, IBM AIX, Solaris,
UNIX file system services and data service applications, provides and A/UX.
Common Linux
Linux is a general term for Unix-like OSs. Linux runs with OSs:
GNU/
Linux high security and stability and has a complete permission SUSE Linux, Kylin, Red
Flag Linux, CentOS,
control mechanism. RHEL, and openEuler.
Common Windows
Windows Server is a server OS released by Microsoft. It is Server versions:
Windows
mainly used on servers and provides a user-friendly GUI. 2000, 2003, 2008, 2012,
2016, and 2019.
10 Huawei Confidential
Contents
11 Huawei Confidential
Features of Linux
Multi-platform design
Linux can run on multiple hardware platforms. The Linux kernel is also used in embedded
systems that run on devices such as handheld computers and set-top boxes.
Multi-user and multitasking
System resources can be used by different users. Multiple programs can run
simultaneously and independently.
Free to use
The source code of Linux is available for free. Users can edit and modify the source code
as required.
Fully compatible with the POSIX.1 standard
Inherits the design concept of Unix
Everything is a file.
12 Huawei Confidential
Linux File Directory Structure
Linux OS adopts "Everything is a file" design.
Linux directories are organized in a tree structure, where / indicates the root
[root@localhost ~]# ls /
directory. bin dev home lib64 media opt root sbin sys
Root /
usr
directory boot etc lib lost+found mnt proc run srv tmp
var
14 Huawei Confidential
Background of openEuler
EulerOS is a server OS that runs on the Linux kernel and supports processors of
multiple architectures, such as x86 and ARM. It is ideal for database, big data,
cloud computing, and artificial intelligence (AI) scenarios.
Over the past decade, EulerOS has interconnected with various Huawei products
and solutions. It is respected for its security, stability, and efficiency.
Cloud computing, in addition to Kunpeng processors, has sparked the growth of
EulerOS to become the most powerful software infrastructure in the Kunpeng
ecosystem.
To develop the Kunpeng ecosystem and build prosperity of the computing
industry in China and around the world, the open source version of EulerOS was
officially released as openEuler at the end of 2019.
15 Huawei Confidential
Introduction to openEuler
openEuler is a free open source Linux distribution that supports multiple processor
architectures including x86, ARM, and RISC-V.
All developers, enterprises, and business organizations can simply use the
openEuler community version, or use it to build, develop, and release their own OS
versions.
https://openeuler.org/
https://gitee.com/openeuler/
16 Huawei Confidential
Relationship Between openEuler and Mainstream OSs
Linux
Kernel
Community • The upstream
edition
Fedora community of
Red Hat Commercial Free edition openEuler, SUSE,
edition RHEL CentOS Debian, and Red Hat is
the kernel community
www.kernel.org.
Debian Ubuntu • The openEuler
community releases
free long-term support
Commercial (LTS) versions,
edition SLES
SUSE enabling operating
Free edition
openSUSE system vendors (OSVs)
such as Kylinsoft, iSoft,
Kylin V10
Community edition Sinosoft, and GreatDB
openEule
openEuler iSoft V5.1 to develop commercial
r Commercial
releases releases.
EulixOS 1.0
17 Huawei Confidential
Contents
18 Huawei Confidential
File System Overview
A file system is a method and a data structure used by an OS to identify files on a
storage device or a partition, that is, a method of organizing files on a storage
device.
In an OS, a software structure that manages and stores file data is referred to as a
file management system, or file system for short.
Underlying storage
Objects and
hardware, such as drives
and partitions properties
19 Huawei Confidential
File Systems on openEuler
The openEuler kernel is derived from Linux. The Linux kernel supports more than 10
types of file systems, such as Btrfs, JFS, ReiserFS, ext, ext2, ext3, ext4, ISO 9660,
XFS, Minix, MSDOS, UMSDOS, VFAT, NTFS, HPFS, SMB, SysV and PROC. The following
table describes the common file systems.
The default file system on openEuler is ext4.
Common File Description
System
Ext File system specially designed for Linux. The latest version is ext4.
A high-performance log file system developed for the IRIX OS by Silicon
XFS Graphics in 1993. Later ported to the Linux kernel, it excels in large-file
processing and provides smooth data transfer.
On Linux, VFAT is the name of the FAT (including FAT16 and FAT32) file
VFAT systems in DOS and Windows.
The standard file system for optical disc media. Linux supports this file
ISO 9600 system, allowing the system to read CD-ROMs and ISO image files, and
burn CD-ROMs.
20 Huawei Confidential
Contents
21 Huawei Confidential
Contents
22 Huawei Confidential
Linux GUI and CLI
A graphical user interface (GUI) presents all elements as graphical. The mouse is
used as the main input tool, and buttons, menus, and dialog boxes are used for
interaction, focusing on ease of use.
All elements on a command line interface (CLI) are character-based. The keyboard is
used as the input tool to enter commands, options, and parameters for executing
programs, achieving high efficiency.
23 Huawei Confidential
Why We Use CLIs
Higher efficiency
On Linux, it is faster to perform operations on a keyboard than using the mouse.
A GUI-based operation cannot be repeated, while a CLI script can be used to complete all
required tasks, for example, deleting outdated log files.
Lower overheads compared with a GUI
Running a GUI requires a large amount of system resources. With the CLI, system
resources can be released and allocated to other operations.
Sometimes, the only choice
Most servers choose not to install a GUI.
Tools for maintaining and managing network devices do not provide a GUI.
24 Huawei Confidential
Linux CLI Shortcuts
Tab completion
Use the Tab key to complete a command or file name, which is time-saving and accurate.
When no command is entered, press Tab twice to list all available commands.
If you have entered a part of the command name or file name, press Tab to complete it
automatically.
Cursor control
↑: Press ↑ several times to display historical commands for quick execution.
↓: Press ↓ together with ↑ for choosing a historical command.
Home: Press Home to move the cursor to the beginning of the line.
Ctrl+A: Press Ctrl+A to move the cursor to the beginning of the line.
Ctrl+E: Press Ctrl+E to move the cursor to the end of the line.
Ctrl+L: Press Ctrl+L to clear the screen.
25 Huawei Confidential
Login to Linux
You can log in to Linux in either of the following ways:
Local login
Remote Login
Using clients such as PuTTY and Xshell to remotely log in to openEuler.
26 Huawei Confidential
Changing the Password
Passwords are used to ensure the security of system and data.
To ensure system security, you should:
Change the password upon the first login.
Change passwords periodically.
Set a complex password, for example, a password containing more than eight characters
and at least three types of the following characters: uppercase letters, lowercase letters,
digits, and special characters.
You can run the passwd command to change the password.
[root@openEuler ~]# passwd # Change the password of the current user.
Changing password for user root.
New password: # Enter the new password.
Retype new password: # Enter the new password again.
passwd: all authentication tokens updated successfully
[root@openEuler ~]# passwd test1 # Change the password of a common user as the root user.
Changing password for user test1.
New password:
BAD PASSWORD: The password is a palindrome
Retype new password:
passwd: all authentication tokens updated successfully.
27 Huawei Confidential
Types of Linux Users
On Linux, a UID is used to uniquely identify a user.
Based on different UIDs, there are three types of users in Linux (openEuler is used
as an example):
Super user
The super user is also called the super administrator. Its UID is 0. The super user has all system
permissions. It is similar to the administrator in Windows.
System user
System users, also called program users, have UIDs ranging from 1 to 999. A system user is
created by a program and is used to run the program or service.
Common user
Common users are generally created by the super administrator (the root user) to perform limited
management and maintenance operations on the system. UIDs of common users range from 1000
28 to 60000.
Huawei Confidential
Creating and Deleting a Linux User
Creating a user (common user by default): useradd username
Viewing user information: id username
Switching users: su - username
Deleting a user: userdel username
29 Huawei Confidential
Contents
30 Huawei Confidential
Power Supply Commands: shutdown and reboot
shutdown is used to shut down the computer, which requires root permissions.
Main options:
-h: powers off the computer after it is shut down.
-r: powers on the computer after it is shut down. (This operation is equivalent to restarting the
computer.)
-p: explicitly indicates that the system will be shut down and the main power supply will be cut off.
reboot is used to restart the computer, which requires system administrator
permissions.
Main options:
-w: writes records to the /var/log/wtmp file. It does not restart the system.
-d: does not write records to the /var/log/wtmp file.
-i: restarts the system with network settings disabled.
31 Huawei Confidential
File Paths
Absolute path: a path starting from the root directory (/), for example,
/root/Desktop.
Relative path: a path starting from the current path, for example, ./Desktop.
./ or . indicates the current path. ../ or .. indicates the upper-level directory of the current
path.
pwd: Viewing the current path
[root@localhost ~]# pwd # View the current path.
/root
cd: Switching paths
[root@localhost ~]# cd /root/Desktop # Go to the Desktop directory using the absolute path.
[root@localhost Desktop]# cd # Run the cd command without a parameter to go to the home directory
of the current user by default.
[root@localhost ~]#
[root@localhost ~]# cd ./Desktop # Go to the Desktop directory using a relative path.
[root@localhost Desktop]# pwd
/root/Desktop
[root@localhost Desktop]# cd ~ # Switch to the home directory of the user. ~ indicates the home
directory of the current user.
[root@localhost ~]# pwd
/root
32 Huawei Confidential
Viewing Files
ls: Viewing the content of a directory
[root@localhost ~]# ls –a # List all files and directories.
ifcfg-lo ifdown-eth ifdown-isdn ifdown-routes
[root@localhost ~]# ls –l # Display detailed information about types, permissions,
owners, and sizes of the files.
total 228
-rw-r----- 1 root root 86 Jun 15 19:03 ifcfg-eth0
-rw-r----- 1 root root 254 Jun 15 19:03 ifcfg-lo
cat, tail, or head: Viewing the content of a common file
[root@localhost ~]# cat ifcfg-eth0 # View all contents of the file.
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Ethernet"
PERSISTENT_DHCLIENT="yes"
[root@localhost ~]# tail -2 ifcfg-eth0 # View the last two lines of the file.
TYPE="Ethernet"
PERSISTENT_DHCLIENT="yes"
[root@localhost ~]# head -2 ifcfg-eth0 # View the first two lines of the file.
DEVICE="eth0"
BOOTPROTO="dhcp"
33 Huawei Confidential
Creating Files
mkdir: Creating directories (folders)
-p: cascades to create multiple directories recursively.
[root@localhost ~]# mkdir my_dir_01 # Create a my_dir_01 directory.
[root@localhost ~]# ls
anaconda-ks.cfg my_dir_01
[root@localhost ~]# mkdir -p my_dir_02/sub_dir # Create a my_dir_02 directory and its
subdirectory sub_dir.
touch: Creating common files
[root@localhost ~]# touch test01.log test02.log # Create files test01.log and test02.log.
[root@localhost ~]# ls -lt
total 0
-rw-------. 1 root root 0 Jul 29 15:06 test01.log
-rw-------. 1 root root 0 Jul 29 15:06 test02.log
34 Huawei Confidential
Copying Files
cp: Copying files or directories
-a: copies the files of a directory while retaining the links and file attributes.
-r: If the source file is a directory, all subdirectories and files in the directories are copied
recursively and the attributes are retained.
[root@localhost ~]# ls
test01.log test02.log
[root@localhost ~]# cp /etc/passwd passwd.back # Copy the /etc/passwd file to the current directory and
rename the file to passwd.back.
[root@localhost ~]# cp -r /var/log/audit ./ # Copy the audit directory and all files in it to the current
directory.
[root@localhost ~]# ls
audit passwd.back test01.log test02.log
[root@localhost ~]# cp -s /etc/passwd passwd_link # Create a symbolic link passwd_link of the passwd file.
[root@localhost ~]# ls
audit passwd.back passwd_link test01.log test02.log
[root@localhost ~]# ls -l
total 8
drwx------. 2 root root 4096 Jul 29 15:24 audit
-rw-------. 1 root root 2546 Jul 29 15:24 passwd.back
lrwxrwxrwx. 1 root root 11 Jul 29 15:25 passwd_link -> /etc/passwd
-rw-------. 1 root root 0 Jan 2 19:20 test01.log
-rw-------. 1 root root 0 Jul 29 19:20 test02.log
[root@localhost ~]#
35 Huawei Confidential
Moving and Renaming Files
mv: Moving or renaming a file
The mv command is used to move a file or directory. Exercise caution when running this
command because data loss risks are involved.
If the source file and target file are in the same directory, the mv command is used to
rename the file.
[root@localhost ~]# ls
passwd_link test01.log test02.log
[root@localhost ~]# mv test02.log test03.log #Change the name of the test02.log file to
test03.log
[root@localhost ~]# ls
passwd_link test01.log test03.log
[root@localhost ~]# mv test01.log /root/test # Move the test01.log file to the /root/test
directory.
[root@localhost ~]# mv –f test01.log test03.log # Forcibly overwrite the test03.log file with
the content of the test01.log file.
36 Huawei Confidential
Deleting Files
rm: Deleting files or directories
The rm command is a high-risk command. No tool can guarantee recovery of files deleted
by the rm command, which does not move a file to a recycle bin like in GUIs. Therefore,
you cannot undo the deletion.
[root@localhost ~]# ls
audit_back passwd.back test01.log test03.log
[root@localhost ~]# rm test01.log # Delete the test01.log file with a prompt
before deletion.
rm: remove regular empty file 'test01.log'? yes
[root@localhost ~]# rm -rf test03.log # Forcibly delete the test03.log
file.
[root@localhost ~]# rm -rf audit_back/ # Delete the mail.bak directory,
including all files and subdirectories in it.
[root@localhost ~]# ls
passwd.back
[root@localhost ~]#
37 Huawei Confidential
Obtaining Help Information About a Command
help: Obtaining simple help information about a command
To navigate the massive number of commands on Linux, you can run the help command
to obtain help information.
Syntax: [command] --help or help [command].
[root@localhost ~]# help pwd
pwd: pwd [-LP]
Print the name of the current working directory.
Options:
-L print the value of $PWD if it names the current working directory
-P print the physical directory, without any symbolic links
Exit Status:
Returns 0 unless an invalid option is given or the current directory cannot be read.
[root@localhost ~]# systemctl --help
systemctl [OPTIONS...] {COMMAND} ...
38 Huawei Confidential
Contents
39 Huawei Confidential
Linux Text Editor - Vim
Vim is a customizable text editor derived from Visual Editor (vi) that inherits,
improves and adds many features to vi's original base.
Common Vim modes:
Normal mode: used to copy, paste, and delete text, undo previous operations, and navigate the cursor.
Insert mode: used to edit and modify text.
Command line mode: used to save, exit, search for, or replace text. Enter a colon (:) to switch to this
mode.
Normal
mode
Esc Esc
: or / a, i, o, or s
40 Huawei Confidential
Normal Mode of Vim
By default, Vim begins to run in normal mode after you open a file with the vim
command.
vim [options] [file]... Edit specified files.
vim [options] - Read text from standard input (stdin).
vim [options] -t tag Edit the file where the tag is defined.
vim [options] -q [errorfile] Edit the file where the first error occurs.
Common options:
-c: runs a specified command before opening a file.
-R: opens a file in read-only mode but allows you to forcibly save the file.
-M: opens a file in read-only mode and does not allow you to forcibly save the file.
-r: recovers a crashed session.
+num: starts at line num.
41 Huawei Confidential
Common Operations in Vim Normal Mode
Cursor control
Arrow keys or k, j, h, and l keys move the cursor up, down, left, and right, respectively.
0: moves the cursor to the beginning of the current line.
g0: moves the cursor to the leftmost character of the current line that is on the screen.
:n: moves the cursor to line n.
gg: moves the cursor to the first line of the file.
G: moves the cursor to the last line of the file.
Data operations
yy or Y: copies an entire line of text.
y[n]w: copies 1 or n words.
d[n]w: deletes (cuts) 1 or n words.
[n] dd: deletes (cuts) 1 or n lines.
42 Huawei Confidential
Insert Mode of Vim
Use the vim filename command to open a file and enter the normal mode by
default. Type i, I, a, A, o, or O to enter the insert mode.
If the filename file exists, the file is opened and the file content is displayed;
otherwise, Vim displays [New File] at the bottom of the screen and creates the file
when saving the file for the first time.
Press Esc to exit the insert mode and return to the normal mode.
[root@openEuler ~]# vim test.txt # Enter the normal mode by default.
~
~
"test.txt" [New File]
[root@openEuler ~]# vim test.txt # Press i, I, a, A, o, or O to enter the insert
mode.
~
~
-- INSERT --
43 Huawei Confidential
Command Line Mode of Vim
Search
:/word or /word: searches for a word string after the cursor. Press n to continue to search forwards or press Shift+n
to search backwards.
Replace
:1,5s/word1/word2/g: replaces all occurrences of word1 in lines 1 to 5 with word2. If g is not specified, only the first
occurrence of word1 in each line is replaced.
%s/word1/word2/gi: replaces all occurrences of word1 with word2. i ignores the case of matches.
Save and exit
:w: Save the file and do not exit.
:wq: Save the file and exit.
:q: Exit without saving the file.
:q!: Exit forcibly without saving changes to the file.
:wq!: Forcibly save the file and exit.
44 Huawei Confidential
Contents
45 Huawei Confidential
Important Network Concepts in openEuler
Host network device: a network adapter on
the host.
Interface
Interfaces on devices are created by drivers for
the system access.
Broadcast address
An IP address used to send packets to all hosts
on the network segment
Subnet mask
A number that distinguishes the network address
and the host address within an IP address
Route
Next-hop IP address when IP packets are
transmitted across network segments
Link: connection between the device and the
network.
46 Huawei Confidential
Commands for Querying IP Addresses
ip and ifconfig commands are used to view IP addresses of the current host.
Viewing information about all network adapters on a host.
Viewing information about a specified interface on a host.
47 Huawei Confidential
Configuring Static IP Addresses Using Network Adapter
Configuration Files
Query the path of the network adapter configuration file:
[root@openEuler ~]# ls /etc/sysconfig/network-scripts/ifcfg-*
/etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-enp0s8
Parameter description: Parameter Description
TYPE Interface type
BOOTPROTO Boot-time protocol
ONBOOT Whether to activate the device at boot-time
IPADDR IP address
NETMASK Subnet mask
GATEWAY Gateway address
BROADCAST Broadcast address
MAC address. Only one MAC address needs to be set. New MAC
HWADDR/MACADDR addresses cannot share the same name as another when they are set
at the same time.
Whether to specify the DNS server address. If the DHCP protocol is
PEERDNS
used, the default value is yes.
DNS{1, 2} DNS server addresses
USERCTL User permission control
NAME Network connection name
DEVICE Physical interface name
48 Huawei Confidential
Configuring the IP Address - Configuration File Example
Set the static IP address of the enp0s3 interface to 192.168.56.100/24.
TYPE=Ethernet
BOOTPROTO=static
NAME=enp0s3
DEVICE=enp0s3
ONBOOT=yes
IPADDR=192.168.56.100
NETMASK=255.255.255.0
Restart the network.
49 /org/freedesktop/NetworkManager/ActiveConnection/12)
Huawei Confidential
Configuring the Static IP Address Using the nmcli
Command
Check network connections of the current host.
[root@openEuler ~]# nmcli connection show
NAME UUID TYPE DEVICE
enp0s3 3c36b8c2-334b-57c7-91b6-4401f3489c69 ethernet enp0s3
enp0s8 00cb8299-feb9-55b6-a378-3fdc720e0bc6 ethernet enp0s8
Configure a static IP address.
[root@openEuler ~]# nmcli connection modify enp0s3 ipv4.method manual ipv4.addresses "10.0.2.10/24" ipv4.gateway
"10.0.2.2"
Restart the network.
[root@openEuler network-scripts]# nmcli connection reload enp0s3
[root@openEuler network-scripts]# nmcli connection up enp0s3
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/18)
View the IP address.
[root@openEuler ~]# ip addr show enp0s3
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen
1000
link/ether 08:00:27:7d:e1:a5 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.10/24 brd 10.0.2.255 scope global noprefixroute enp0s3
valid_lft forever preferred_lft forever
50 Huawei Confidential
Introduction to Routes
To facilitate communication between two hosts in different subnets, a mechanism is
required to describe the path for traffic. This mechanism is called routing, which is
set using routing entries.
A routing entry is a pair of predefined addresses, including the destination and
gateway. It indicates a gateway through which the destination can be reached.
The routing table is a collection of routing entries.
51 Huawei Confidential
Route Management and Configuration
In openEuler, the route command is used to view, configure, and manage local
routes.
In addition to the route command, the ip command can also be used to manage
system routes.
These commands will modify the routing table of the system. When the system is
started, the routing table is loaded to the memory and maintained by the kernel.
52 Huawei Confidential
Viewing the Routing Table Using the route Command
Run the route command to view the routing table.
53 Huawei Confidential
Adding a Route Using the route Command
Add a (temporary) route to a network segment or host.
route [-f] [-p] [Command [Destination] [mask Netmask] [Gateway] [metric Metric]] [if Interface]]
Example:
[root@openEuler ~]# route add -net 192.168.101.0 netmask 255.255.255.0 dev enp4s0
[root@openEuler ~]# route add -host 192.168.100.10 dev enp4s0
[root@openEuler ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default _gateway 0.0.0.0 UG 100 0 0 enp4s0
192.168.100.10 0.0.0.0 255.255.255.255 UH 0 0 0 enp4s0
192.168.101.0 0.0.0.0 255.255.255.0 U 0 0 0 enp4s0
192.168.110.0 0.0.0.0 255.255.255.0 U 100 0 0 enp4s0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
54 Huawei Confidential
Deleting a Route Using the route Command
Deleting a route to a network segment or host using the route del command.
Syntax:
route del [-net|-host] [netmask Nm] [gw Gw] [[dev] If]
Example:
55 Huawei Confidential
Host Name
A host name identifies a device in a local area network (LAN).
The device can be a physical or virtual machine.
The host name is stored in the /etc/hostname file.
56 Huawei Confidential
Setting the Host Name
Setting a temporary host name: hostname new-name
Setting a permanent host name: hostnamectl set-hostname new-name
Setting a host name by modifying the file: write new-name to the /etc/hostname
file.
[root@openEuler ~]# hostname
openEuler
[root@openEuler ~]# hostname huawei
[root@openEuler ~]# hostname
huawei
[root@openEuler ~]# hostnamectl set-hostname openEuler01
[root@openEuler ~]# hostname
openEuler01
[root@openEuler ~]# echo "HCIA-openEuler" > /etc/hostname
57 Huawei Confidential
Introduction to the hosts File
Hosts in a LAN can be accessed through IP addresses.
IP addresses are difficult to remember when a large number of hosts exist in the
LAN. Therefore, we want to access the hosts directly through their host names.
In this case, the hosts can be located using a table that records the mapping
between host names and IP addresses. This table is the hosts file.
[root@openEuler ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4
localhost4.localdomain4
::1 localhost localhost.localdomain localhost6
localhost4.localdomain6
58 Huawei Confidential
Modifying the hosts File
You can edit the hosts file in the following format:
# Ip domain.com
192.168.10.20 www.example.com
To delete an entry, add # to comment it out. For example:
#ip domain.com
#192.168.10.20 www.example.com
59 Huawei Confidential
Quiz
1. Which of the following statements is incorrect about file systems?
A. A file system is a method and a data structure used by an OS to identify files on
a storage device or a partition.
B. The software structure that manages and stores file data is referred to as a file
management system.
C. The file system manages and controls computer hardware and software
resources.
D. The file system organizes and allocates the space on file storage devices, stores
files, and protects and retrieves the stored files.
2. Linux is a multi-user OS that allows multiple users to log in at the same
time and allows one user to log in multiple times.
A. True
B. False
60 Huawei Confidential
Summary
This course discusses the basic components and types of OSs and
basic operations of Linux. Now, we have finished learning the basics
about computing, storage, network, and OS technologies. In cloud
computing, how can we use and manage the resources to provide
services for applications? We will address these issues in the next
course about virtualization technology.
61 Huawei Confidential
Recommendations
Huawei iLearning
https://e.huawei.com/en/talent/portal/#/
Huawei Support Knowledge Base
https://support.huawei.com/enterprise/en/knowledge?lang=en
62 Huawei Confidential
Acronyms and Abbreviations
CLI: Command Line Interface
63 Huawei Confidential
Thank you. 把数字世界带入每个人、每个家庭、
每个组织,构建万物互联的智能世界。
Bring digital to every person, home, and
organization for a fully connected,
intelligent world.