Linux is a versatile operating system available in numerous distributions ("distros"
) that are customized for different uses. Unlike proprietary alternatives, Linux manages computer hardware resources while allowing various software applications to communicate with the underlying components.
Components
Linux consists of various interrelated components that together create a functional operating system environment.
Component Description Bootloader
Code that initiates the operating system startup, such GRUB. OS Kernel
Core component managing hardware resources and I/O operations Daemons
Background services ensuring key functions like scheduling and printing work properly OS Shell
Command-line interface ( CLI
) between user and system (common shells: Bash, Zsh, Fish)Graphics server
"X"
or"X-server"
subsystem that enables graphical applications to runWindow Manager
Graphical interface ( GUI
) like GNOME or KDE providing desktop environment with file browsersUtilities
Programs performing specific functions for users or other applications
Linux Architecture
The Linux operating system can be broken down into layers:
Layer Description Hardware
Physical components (RAM, CPU, storage devices) Kernel
Core system that virtualizes and controls hardware resources, preventing conflicts between processes Shell
Command-line interface (CLI) for executing kernel functions via user commands System Utility
Programs that perform specific maintenance or configuration tasks
File System Hierarchy
The Linux operating system follows a
tree-like structure
documented in the Filesystem Hierarchy Standard (FHS
), organizing system resources into standardized top-level directories that create a consistent arrangement across distributions.graph TD root["/"] --> bin["/bin"] root --> boot["/boot"] root --> dev["/dev"] root --> etc["/etc"] root --> home["/home"] root --> lib["/lib"] root --> media["/media"] root --> mnt["/mnt"] root --> opt["/opt"] root --> proc["/proc"] root --> root_dir["/root"] root --> run["/run"] root --> sbin["/sbin"] root --> sys["/sys"] root --> tmp["/tmp"] root --> usr["/usr"] root --> var["/var"]
Path Description /
Root filesystem containing files needed to boot the OS /bin
Essential command binaries /boot
Bootloader, kernel, and boot files /dev
Device files for hardware access /etc
System and application configuration files /home
User home directories /lib
Shared libraries needed for system boot /media
Mount point for removable media /mnt
Temporary mount point for filesystems /opt
Optional third-party applications /root
Home directory for the root user /sbin
System administration binaries /tmp
Temporary files (cleared on boot) /usr
User programs, libraries and documentation /var
Variable data (logs, emails, web files)
Linux Version
# Get linux version - works on most distributions
cat /etc/*-release
# Get linux version - kernel version only
uname -r
# Get linux version - full kernel information
uname -a
# Get linux version - detailed hardware and OS info
hostnamectl
Files & Directories Permission
SUID & SGID
Special permission bits that temporarily elevate privileges. SUID
allows users to run programs with the file owner’s permissions, while SGID
runs with the file’s group permissions. These enable administrators to grant limited elevated access for specific applications without giving users permanent higher privileges.
# Find SUID files
find / -perm -4000 -type f -exec ls -l {} \; 2>/dev/null
# OR using symbolic notation
find / -perm -u=s -type f -exec ls -l {} \; 2>/dev/null
# Find SGID files
find / -perm -2000 -type f -exec ls -l {} \; 2>/dev/null
# OR using symbolic notation
find / -perm -g=s -type f -exec ls -l {} \; 2>/dev/null