CHAPTER ONE
Introduction to System & Network
Administration
1
• Objectives/Goals, Challenges and Common Practices
• Overview of the OSs
• Unix-like Systems Vs Windows Systems
• Linux Distributions and UIs
• Linux Operations Review
– File system Hierarchy and Standard
– Single-rooted hierarchy, Seamless and Extensible File systems
– Mounting Additional File systems
– File system Object Oriented Design and File system Standard
– Unix File and Directory Permissions
– Essential Shell Commands
– Basic File Manipulation Commands and Directory Navigation
Commands
– Advanced File Manipulation Commands (Init, Processes, and
Threads)
– Advanced Shell Features
2
Objectives/Goals, Challenges and Common Practices
• A system is a collection of elements or components that are organized
for a common purpose.
• Network is a group of interconnected (via wire and/or wireless) devices
and peripherals that is capable of sharing software and hardware
resources among many users.
3
Cont’d…
The terms network administration and system administration exist
separately;
Network administration is the management of network infrastructure
devices (routers and switches).
System administration is a branch of engineering mainly concerned
with the operational management of human-computer systems.
An organized collaboration between humans and computers to solve a
problem or provide a service.
Is the term used traditionally by mainframe and Unix engineers to
describe the management of computers whether they are coupled by a
network or not
4
What is the Key Role of Network and System Administration?
It is to build hardware configuration and to configure software
systems.
Network Administrator: a person who responsible to
admin,
manage and maintain the network design,
configuration and infrastructure development.
System Administrator: a person who responsible to
admin users,
maintaining system,
create file systems,
install software and other related issues
5
• The primary objective of system administration is to ensure that
the systems are running smoothly, securely, and efficiently,
providing uninterrupted service to end-users.
6
Overview of the OSs
• An Operating System (OS) is an interface between a computer user and
computer hardware.
• An operating system is a software which performs all the basic tasks like:
file management,
memory management,
process management,
handling input and output, and
controlling peripheral devices
such as disk drives and printers.
7
Cont’d…
• The primary purposes of an Operating System are:
– to enable applications (software) to interact with a computer's
hardware &
– to manage a system's hardware and software resources.
• The software that contains the core components of the operating system
is called the kernel.
• Some popular Operating Systems include Unix, Windows, etc.
• Today, OS is found almost in every device like mobile phones, personal
computers, mainframe computers, automobiles, TV, Toys etc.
8
Unix-like Systems Vs Windows Systems
Feature Unix-like Systems Windows Systems
Operating System Linux, macOS, BSD Windows 10, Windows Server
User Interface Command-line interface (CLI) Graphical User Interface (GUI)
File System Ext4, APFS, ZFS NTFS, FAT32
Generally more secure due to permissions Vulnerable to viruses and malware, but
Security
system and less malware targeting improving with each version
Highly customizable with various Limited customization options compared to
Customization
distributions and desktop environments Unix-like systems
Vast repository of open-source software Extensive commercial software support with
Software Availability
available through package managers some open-source options available
Good support for a wide range of hardware Generally good hardware support, but may be
Hardware Support
due to open-source nature limited for older devices
Known for stability and performance on Widely used in desktop environments and
Performance servers and high-performance computing gaming, with performance improvements in
systems recent versions
9
Linux Distributions and UIs
• Other operating systems like Microsoft combine each bit of codes
internally and release it as a single package.
• But Linux is different from them. Different parts of Linux are developed
by different organizations.
• Different parts include kernel, shell utilities, X server, system
environment, graphical programs, etc.
• If you want you can access the codes of all these parts and assemble
them yourself, but its not an easy task.
10
Cont’d… Linux Distributions and UIs
• Distribution (distros) assemble all these parts for us and give us a
compiled operating system of Linux to install and use.
• Linux distributions, also known as distros, are variations of the Linux
operating system that are tailored to meet specific needs.
• Each Linux distribution comes with its own set of features and user
interface, and choosing the right one can make a big difference in how
you use your computer.
11
Cont’d…
Here are some of the most popular Linux distributions available,
including rolling-release distributions: Ubuntu, Debian, fedora, CentOS,
Mint,…etc
Ubuntu: Ubuntu is one of the most widely used Linux distributions. It
is known for its user-friendly interface and easy installation process.
Debian: Debian is a Linux distribution that is known for its stability
and security. It is widely used in servers and is the base for many other
Linux distributions.
12
Cont’d…
User Interfaces (UIs)
• The user interface of a Linux distribution is crucial as it determines how
users interact with the operating system.
• There are several popular UIs used in Linux distributions, each offering
a unique user experience:
GNOME: GNOME is one of the most widely used desktop
environments in Linux distributions.
• It provides a clean and user-friendly experience for both novice and
experienced users.
KDE Plasma: KDE Plasma is another popular desktop environment that
offers a highly customizable and feature-rich interface.
13
Cont’d…
Cinnamon: Cinnamon is a desktop environment developed by the
Linux Mint team.
It provides a classic desktop experience similar to Windows, with a
start menu, taskbar, system tray, and desktop icons.
Mate: Mate is a fork of the GNOME 2 desktop environment, offering a
traditional desktop layout with a focus on stability and performance.
Unity: Unity was the default desktop environment for Ubuntu until
version 17.04 when it was replaced by GNOME.
14
Linux Operations Review: File system Hierarchy and Standard
• Understanding Linux operations is essential for effectively managing and
maintaining Linux-based systems.
The File System Hierarchy Standard (FHS) is a document that outlines the
standardized structure and organization of directories and files in Unix-like
operating systems, such as Linux and FreeBSD.
Single-rooted Hierarchy in Linux:
• Means that there is a single top-level directory from which all other directories
and files stem.
• This top-level directory is represented by the forward slash (/). All other
directories and files are organized beneath this root directory in a tree-like
structure. This hierarchical organization simplifies file management and
navigation within the system.
15
Cont’d…
Seamless File Systems in Linux:
• Linux file systems are designed to be seamless, allowing for smooth
and efficient data storage and retrieval.
• The extensible nature of Linux file systems enables users to easily add
new features or modify existing ones without disrupting the overall
system functionality.
• This extensibility contributes to the flexibility and scalability of Linux
file systems, making them adaptable to various user needs and
requirements.
16
Cont’d…
Extensible File Systems in Linux:
• One of the key strengths of Linux file systems is their extensibility.
• Users have the ability to extend or enhance the functionality of the file
system by incorporating additional features or customizations.
• This extensibility allows for greater customization and optimization of
the file system to suit specific use cases or preferences.
• Additionally, it promotes innovation and development within the Linux
community, leading to continuous improvements in file system
technology.
17
Mounting Additional File systems
In Linux, mounting additional file systems allows users to access and
utilize storage devices or partitions that are not part of the main system.
This process involves attaching the file system to a specific directory in
the Linux file structure, making its contents accessible to the user.
Steps to Mount Additional File systems:
1. Identify the File System: Before mounting a new file system, you
need to determine the type of file system it uses. Common file system
types in Linux include ext4, NTFS, FAT32, and more.
2. Create a Mount Point: Choose or create a directory where you want
to access the contents of the new file system. This directory will serve
as the mount point.
18
Cont’d…
3. Mount the File System: Use the mount command followed by the
device name and mount point to attach the new file system. For example:
• sudo mount /dev/sdb1 /mnt/newfilesystem
4. Verify Mounting: Check if the new file system has been successfully
mounted by listing the contents of the mount point directory.
5. Automount on Boot: To ensure that the additional file system is
mounted automatically upon system boot, you can add an entry to
the /etc/fstab file.
6. Unmounting File systems: When you no longer need access to a
mounted file system, you can unmount it using the umount command:
• sudo umount /mnt/newfilesystem
19
File system Object Oriented Design and File system Standard
• An object-oriented design for a file system might involve the following
classes:
• File: This class would represent an individual file in the file system. It
would have attributes such as name, size, and creation date, and
methods such as read() and write().
• Directory: This class would represent a directory in the file system. It
would have attributes such as name and a list of contained files and
directories, and methods such as add() and remove().
• File System: This class would represent the file system as a whole. It
would have attributes such as the root directory and the current working
directory, and methods such as changeDirectory() and createFile().
20
File System: Standard in Linux
• The file system standard in Linux is known as the Virtual File
System (VFS).
• It provides a uniform interface to different types of file systems,
such as ext4, FAT32, and NTFS.
• The VFS defines a set of operations that can be performed on files
and directories, such as open(), read(), write(), and close().
• These operations are implemented by the specific file system drivers
that are responsible for accessing the underlying physical storage.
• The Linux VFS uses a tree-like structure to organize files and
directories.
21
• The root of the tree is represented by the “/“ directory, which contains
other directories such as “home”, “bin”, and “etc”. Each directory can
contain files and other directories.
• The current working directory is represented by the “.” (dot) directory,
and the parent directory is represented by the “..” (dot dot) directory.
• In Linux, files are treated as first-class citizens, meaning that they are
assigned unique identifiers (inodes) and can be manipulated using
various commands (such as ls, cp, and rm).
• The file system also supports symbolic links, which allow one file to
refer to another file or directory.
22
Unix File and Directory Permissions
• In Unix-based operating systems, file and directory permissions are
used to control access and manage security for users and groups.
• These permissions consist of three types: read (r), write (w), and
execute (x). Each permission can be assigned to the file owner (user),
the group members associated with the file, or all other users (others).
• To represent these permissions, a combination of letters and symbols is
used. The format for displaying permissions is as follows:
• rwxrwxrwx
• Each character represents a permission type for the user, group, and
others, respectively. For example, if the first character is “r,” it means
the user has read permission for the file or directory.
23
Cont’d…
• Here’s a breakdown of the permission types:
• Read (r): Allows users to view the contents of a file or list the files
in a directory.
• Write (w): Enables users to modify or delete a file, as well as add,
remove, or rename files in a directory.
• Execute (x): Grants permission to run a file (if it’s an executable) or
access a directory’s contents.
• To understand how these permissions are applied, let’s consider an
example:
• drwxr-xr-x
• In this example, the first character “d” indicates that it’s a directory. The
next nine characters represent the permissions for the user, group, and
others, respectively. In this case, the directory has read, write, and execute
permissions for the owner (first rwx group becomes drwx), read and
execute permissions for the group members (second r-x becomes r-x), and
read and execute permissions for all other users (third r-x becomes r-x).
24
Essential Shell Commands
• The shell is a command line interface (CLI) that allows users to interact
with an operating system by typing commands.
• It provides a way to execute tasks, manage files, and automate
processes. Here are some essential shell commands that every user
should know:
– Basic File Manipulation Commands and Directory
Navigation Commands
– Advanced File Manipulation Commands (Init, Processes,
and Threads)
25
Basic File Manipulation Commands and Directory Navigation Commands
Basic File Manipulation Commands
• Are essential for interacting with files in a Unix-based operating system.
• Some of the basic file manipulation commands:
– ls: This command lists the files and directories in the current directory.
– cd: This command is used to change the current directory.
– pwd: This command prints the current working directory.
– mkdir: This command creates a new directory.
– touch: This command creates a new empty file.
– cp: This command copies files or directories.
– mv: This command moves files or directories.
– rm: This command removes files or directories.
26
Cont’d…
• Directory Navigation Commands
• Help users move between different directories in a Unix-based
operating system.
• Here are some common directory navigation commands:
• cd: The cd command is used to change the current directory.
• pwd: The pwd command prints the current working directory.
• ls: The ls command lists the files and directories in the current directory.
• cd ..: This command moves up one level in the directory structure.
• cd ~: This command takes you to your home directory.
• cd /path/to/directory: This command allows you to navigate directly to
a specific directory.
27
Advanced File Manipulation Commands (Init, Processes, and Threads)
• File manipulation commands in a computer system are essential for
managing files, processes, and threads efficiently. Here is an overview
of advanced file manipulation commands related to initialization (init),
processes, and threads:
Initialization (Init)
• init: The init command is used to initialize the system during the boot
process. It is typically the first process started by the kernel and has a
process ID (PID) of 1. init is responsible for starting and managing
other processes in the system.
• systemd: Modern Linux distributions often use systemd as the init
system instead of traditional init.
28
Cont’d…
Processes
• ps: The ps command displays information about currently running
processes. It provides details such as process IDs (PIDs), CPU and
memory usage, parent process IDs, and more. Options like -aux or -
ef can be used to show detailed information.
• kill: The kill command is used to terminate processes by sending
signals to them.
• For immediate termination, SIGKILL signal can be sent.
• pgrep: The pgrep command is used to search for processes based on
their names or other attributes and print their PIDs. It is useful for
automating tasks that involve specific processes.
29
Cont’d…
• Threads
• ps -T: Adding the -T option to the ps command allows users to view
threads associated with each process. Threads share resources within a
process and are scheduled independently by the operating system.
• pthread_create: In programming, particularly in languages like C or
C++, pthread_create is a function used to create a new thread within a
process. This function initializes a new thread with specified attributes and
starts its execution.
• top: While not a specific thread manipulation command, the top command
provides real-time information about processes and threads running on a
system. It displays CPU usage, memory usage, and other details that can
help monitor thread activity.
30
Advanced Shell Features in Linux
• In Linux, the shell is a command-line interpreter that allows users to
interact with the operating system.
• Some of these advanced features include:
1. Tab Completion: Tab completion is a feature that allows users to type
a partial command or file path and then press the Tab key to
automatically complete the rest of the command or path. This can save
time and reduce errors when typing long commands or paths.
2. History: The shell keeps a history of previously executed commands,
which users can access using the up and down arrow keys. This feature
allows users to easily repeat or modify previous commands without
retyping them.
3. Aliases: Aliases are custom shortcuts for commands or command
sequences. Users can define aliases in their shell configuration files to
create shorthand versions of commonly used commands or complex
command sequences.
31
Cont’d…
• 4. Job Control: Job control allows users to manage multiple processes
running in the background. Users can start, stop, pause, resume, and manage
background processes using job control features in the shell.
• 5. Redirection and Pipes: Redirection and pipes allow users to manipulate
input and output streams of commands. Users can redirect command output to
files, append output to existing files, and chain multiple commands together
using pipes to create powerful command pipelines.
• 6. Scripting: The shell scripting language allows users to automate tasks by
writing scripts that contain a series of shell commands. Shell scripts can be
used to perform complex operations, automate repetitive tasks, and customize
the behavior of the shell.
• 7. Command Substitution: Command substitution allows users to capture the
output of a command and use it as input for another command. This feature is
useful for passing dynamic values between commands and incorporating
command output into scripts or complex commands.
• 8. Conditional Expressions: Conditional expressions in shell scripting allow
users to create branching logic based on conditions such as file existence,
variable values, or command exit statuses. Conditional expressions enable
users to create flexible and dynamic scripts that adapt to different scenarios.
• Overall, these advanced features in Linux shells provide users with powerful
tools for interacting with the operating system, automating tasks, and
customizing their shell environment to suit their needs.
32