Knowledge

Base linux concepts

The kernel and the system around it

When you open an app or save a file, the operating system starts programs and helps them use memory, storage, and devices. Linux systems have a core program called the kernel that does this work. It schedules running programs, controls access to hardware, and provides operations that programs can request. In everyday conversation, people often say “Linux” to mean the whole operating system built around that kernel.

That complete system is usually a distribution, or distro. A distribution packages the kernel with libraries, utilities, a package manager, service tools, and its own configuration. Commands and defaults can vary between distributions, so the same task may use different tools on different systems.

Programs usually run outside the kernel in user space and ask for kernel services through libraries or system calls. A shell is one user-space program: it reads command syntax, expands variables and patterns, and starts builtins or separate programs. The kernel tracks each running program as a process with an ID and credentials. The prompt belongs to the shell and terminal interface; the kernel does its work underneath them.

Find files in one directory tree

Linux presents files in a directory tree rooted at /. An absolute path such as /home/sam/notes.txt starts at that root. A relative path such as notes.txt starts in the current working directory, which pwd prints. Common locations include /etc for configuration, /home for user folders, /usr for many programs and shared data, and /var for changing data such as logs and caches. Some paths are symbolic links, and the exact layout can vary.

/proc and /sys are pseudo-filesystems: they look like files and folders but expose information supplied by the kernel. /proc includes process and system details; /sys presents devices and kernel objects. Some entries can be written to as controls, so check what a file does before writing to it.

Identify this system

These read-only commands show the distribution, running kernel, current account, and working directory:

cat /etc/os-release
uname -r
id
pwd

/etc/os-release describes the distribution. uname -r reports the running kernel release, while id shows user and group IDs. The distribution version and kernel version answer different questions; a username alone does not describe every credential attached to a process.

Package commands are distribution-specific. Debian-family systems commonly use apt; Fedora-family systems commonly use dnf. Service managers and network tools can vary too, so check what is installed before copying a command from another system.

An environment assignment such as LANG=C command gives that value to the launched command without changing a machine-wide setting. The program may use it to choose messages or formatting. A command at the prompt can also be a shell builtin or an executable, which affects how the shell starts it and where its manual page is found.

When something fails, identify the layer involved: shell syntax, a user-space utility, a process credential, a kernel interface, a path, or a distribution-specific setting. That narrows the next inspection step.

Interactive exercises

Skillsets
Skillset Skyeng SRE preview
image descriptionSkyeng SRE
by Yuliya Marochkina
12 users
Skillset Linux administrator preview
image descriptionLinux administrator
by Infinite Education
3080 users
Skillset Devops preview
image descriptionDevops
by Ajay Kumar
2004 users
Skillset Linux for backend developer preview
image descriptionLinux for backend developer
by Artem Naumenko (fb)
16 users
Skillset Skyeng linux system administrator preview
image descriptionSkyeng linux system administrator
by Vitaliy Okulov
3 users
Skillset Devops preview
image descriptionDevops
by Dio
3 users
Do you know that ...?
Any useful or interesting facts about the skill. Any peace of information would be useful