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
- 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.
How it works
What an OS does
| Function | What it means |
|---|---|
| Process management | Creates, schedules and ends processes so many programs share the CPU |
| Memory management | Allocates memory to processes and isolates them from each other |
| File management | Organizes data into files and directories on storage |
| Device management | Drives hardware through device drivers |
| User interface | Offers 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.
| Distribution | Notes |
|---|---|
| Red Hat Enterprise Linux (RHEL) | Commercial, RPM packages, widely used in enterprises |
| CentOS | Community distribution derived from RHEL; today CentOS Stream sits just upstream of RHEL |
| SUSE Linux Enterprise | Commercial, RPM packages |
| Ubuntu, Debian | DEB packages, popular on cloud VMs |
| openEuler | Open source distribution started by Huawei, supports x86 and ARM (Kunpeng) |
| EulerOS | Huawei'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.
| Directory | Contents |
|---|---|
| /bin, /sbin | Essential user and system commands |
| /boot | Kernel and boot loader files |
| /dev | Device files, such as disks |
| /etc | System configuration files |
| /home | Home directories of normal users |
| /root | Home directory of the root user |
| /tmp | Temporary files |
| /usr | Installed programs and libraries |
| /var | Changing data such as logs in /var/log |
| /proc | Virtual 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
| Task | Commands |
|---|---|
| Where am I, what is here | pwd, ls -l, ls -a (shows hidden files) |
| Move around | cd /var/log, cd .., cd ~ |
| Create and remove | mkdir -p a/b, touch file, rm file, rm -r dir, rmdir dir |
| Copy and move | cp file1 file2, cp -r dir1 dir2, mv old new (also renames) |
| View files | cat, more, less, head -n 20, tail -f /var/log/messages |
| Search | find / -name hosts, grep error file |
| Archive | tar -czvf backup.tar.gz dir, tar -xzvf backup.tar.gz |
| Help | man 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
| Task | Commands |
|---|---|
| Show addresses | ip addr, or the older ifconfig |
| Test reachability | ping 192.168.1.1 |
| Show listening ports | ss -tlnp |
| Manage services | systemctl status sshd, systemctl start, stop, restart, enable |
| Shut down or restart | shutdown -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.
| Last line command | Effect |
|---|---|
:w | Save |
:q | Quit if nothing changed |
:wq or :x | Save 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.
systemctlmanages services;ip addrshows addresses;tar -czvfcreates a compressed archive.- vi has command, insert and last line modes;
:wqsaves and quits,:q!quits without saving.
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/logand user homes under/home.What does
chmod 755 fileset?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.