Operating System Basics · Topic 1 of 1

Operating Systems and Basic Linux Operations

Learn OS functions, kernel and shell, Linux distributions such as openEuler, the directory tree, file and user commands, chmod permissions and vi modes.

  • 5 min
In a nutshell
  • The kernel manages hardware and resources; the shell interprets user commands.
  • Linux has one tree from /; configuration lives in /etc, logs in /var/log, root's home is /root.
  • r = 4, w = 2, x = 1, in the order owner, group, others.

What it is

An operating system (OS) is the software layer between the hardware and applications. It manages CPU time, memory, storage and devices for programs and users.

Linux is the OS most cloud platforms run on. Virtualization hosts and most cloud VMs use it, so basic Linux skills are essential.

UserShellreads commandsSystem callsKernelscheduling, memory, files, driversHardware

How it works

What an OS does

FunctionWhat it means
Process managementCreates, schedules and ends processes so many programs share the CPU
Memory managementAllocates memory to processes and isolates them from each other
File managementOrganizes data into files and directories on storage
Device managementDrives hardware through device drivers
User interfaceOffers a command line (shell) or a graphical desktop

The kernel is the core that does this work and talks to the hardware. The shell is the command interpreter that reads what the user types and asks the kernel to do it.

Bash is the most common Linux shell. Common OS families are Windows, UNIX, macOS and Linux.

Linux and its distributions

Linus Torvalds released the first Linux kernel in 1991 as open source under the GPL. A distribution bundles the kernel with tools, libraries and a package manager.

DistributionNotes
Red Hat Enterprise Linux (RHEL)Commercial, RPM packages, widely used in enterprises
CentOSCommunity distribution derived from RHEL; today CentOS Stream sits just upstream of RHEL
SUSE Linux EnterpriseCommercial, RPM packages
Ubuntu, DebianDEB packages, popular on cloud VMs
openEulerOpen source distribution started by Huawei, supports x86 and ARM (Kunpeng)
EulerOSHuawei's commercial server OS

The directory tree

Linux has one tree that starts at the root, /. Disks and partitions are mounted somewhere inside it, not given drive letters.

DirectoryContents
/bin, /sbinEssential user and system commands
/bootKernel and boot loader files
/devDevice files, such as disks
/etcSystem configuration files
/homeHome directories of normal users
/rootHome directory of the root user
/tmpTemporary files
/usrInstalled programs and libraries
/varChanging data such as logs in /var/log
/procVirtual files showing kernel and process information

An absolute path starts at /, such as /etc/hosts. A relative path starts from the current directory: . is the current directory, .. the parent and ~ the user's home. The prompt ends in # for root and $ for a normal user.

Common commands

TaskCommands
Where am I, what is herepwd, ls -l, ls -a (shows hidden files)
Move aroundcd /var/log, cd .., cd ~
Create and removemkdir -p a/b, touch file, rm file, rm -r dir, rmdir dir
Copy and movecp file1 file2, cp -r dir1 dir2, mv old new (also renames)
View filescat, more, less, head -n 20, tail -f /var/log/messages
Searchfind / -name hosts, grep error file
Archivetar -czvf backup.tar.gz dir, tar -xzvf backup.tar.gz
Helpman ls, ls --help

Users and permissions

useradd user1 creates a user, passwd user1 sets the password, and su - user1 switches to it. User accounts are listed in /etc/passwd and password hashes in /etc/shadow.

ls -l shows permissions as ten characters, such as -rwxr-xr--. The first is the file type (- file, d directory), then three groups of rwx for the owner, the group and others. In numbers, r is 4, w is 2 and x is 1.

chmod 754 script.sh        # owner rwx, group r-x, others r--
chown user1:group1 file    # change owner and group

Network and services

TaskCommands
Show addressesip addr, or the older ifconfig
Test reachabilityping 192.168.1.1
Show listening portsss -tlnp
Manage servicessystemctl status sshd, systemctl start, stop, restart, enable
Shut down or restartshutdown -h now, reboot

On RHEL family systems such as CentOS and openEuler, interface settings are traditionally kept in files such as /etc/sysconfig/network-scripts/ifcfg-eth0.

The vi editor

vi (and its improved version vim) has three modes.

Command modemove, copy, deleteInsert modepress i, type textBack to command modepress EscLast line modetype a colon
Last line commandEffect
:wSave
:qQuit if nothing changed
:wq or :xSave and quit
:q!Quit without saving

A worked example

An engineer must change a host's name server setting. They run cd /etc, check with pwd, back up the file with cp resolv.conf resolv.conf.bak, and open it with vi resolv.conf.

They press i, edit the line, press Esc and type :wq. Then they check it with cat.

How the exam asks about this

  • "Which command shows the current working directory?" → pwd.
  • "Which permissions does chmod 640 give?" → Owner read and write, group read, others nothing.
  • "Which vi command quits without saving changes?" → :q!.

What to remember for the exam

  • The kernel manages hardware and resources; the shell interprets user commands.
  • Linux has one tree from /; configuration lives in /etc, logs in /var/log, root's home is /root.
  • r = 4, w = 2, x = 1, in the order owner, group, others.
  • systemctl manages services; ip addr shows addresses; tar -czvf creates a compressed archive.
  • vi has command, insert and last line modes; :wq saves and quits, :q! quits without saving.
Watch out

rm -r deletes a directory tree without a recycle bin. Check the path with pwd and ls before running it, especially as root.

Common mistakes

Confusing /root and /. / is the top of the whole tree. /root is only the root user's home directory.

Reading permissions in the wrong order. The three groups are always owner, group, others. In -rw-r----- only the owner can write.

Thinking mv only moves files. mv also renames a file or directory when the target is in the same place.

Check yourself

  • What is the difference between the kernel and the shell?

    The kernel manages the hardware, processes and memory. The shell reads the user's commands and passes the work to the kernel.

  • Which directory holds most system configuration files?

    /etc. Logs are under /var/log and user homes under /home.

  • What does chmod 755 file set?

    Read, write and execute for the owner, and read and execute for the group and for others.

Topic 1 of 1 in Operating System Basics

Test yourself on Operating System Basics

The full Huawei H13-511 question bank has 600 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Huawei. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.