Menu

Log in

Sign up

From beginner to master of web design, coding, infrastructure operation, business development and marketing

  • COURSES
  • HTML & CSS Introduction
  • HTML & CSS Coding with AI
  • Linux Introduction
  • Docker Basics
  • Git & GitHub Introduction
  • JavaScript Coding with AI
  • Django Introduction
  • AWS Basics
  • Figma Introduction
  • SEO Tutorial for Beginners
  • SEO with AI
  • OTHERS
  • About
  • Terms of Service
  • Privacy Policy

© 2024 D-Libro. All Rights Reserved

Linux IntroductionChapter 8. Process Management

Chapter 8. Linux Process Management

Managing Processes in Linux

This chapter covers key concepts of processes on Linux and how to manage those processes. In this chapter, we demonstrate case examples using SSH remote login. If you haven't done SSH remote login setup yet, check the following topic pages.

  • SSH Remote Login (1) – Use Key Pair Generated by Server
  • SSH Remote Login (2) – Use Key Pair Generated by Client
  • SSH Config File
  • SSH Remote Login with Visual Studio Code

Once you confirm the above settings are performed, connect with the server using your terminal or VS Code.

To connect to the remote server using the terminal:

Run the command below.

Command Line - INPUT (Local)
ssh ssh_test

To connect to the remote server using VS Code:

Use GUI (Graphic User Interface). Open the Remote SSH extension and select the SSH host connected with the Lightsail instance.

Open the Remote SSH extension in VS Code

Once the SSH remote login is established, the terminal will look like shown below.

Command Line - INPUT
 

What We Cover in This Chapter

The following topics are covered in this chapter:

Process and Job

In this section, we'll explore the distinction between processes and jobs in Linux. Jobs are processes initiated by the terminal, whereas processes are any programs running on the system. We’ll cover how job IDs and process IDs are used for management and differentiation in Linux.

Foreground and Background Jobs

In this section, we’ll cover the difference between foreground and background jobs. We'll also look at how to run jobs in the background, as well as how to suspend and resume them, which is essential for multitasking in Linux.

jobs and ps (Display Jobs and Processes)

Here, we'll introduce two important commands: jobs and ps. The jobs command lists the jobs running in the background, while ps helps display the active processes. We’ll cover how to use these commands effectively to manage your system's processes.

Signals

In this section, we'll explain how Linux uses signals to interact with processes. You’ll learn how to send signals like SIGTERM and SIGKILL to stop, suspend, or kill processes. We’ll also demonstrate using keyboard shortcuts like Ctrl+C and Ctrl+Z.

Create, Stop and Switch Jobs

We’ll show you how to create, stop, and switch jobs between the foreground and background. By the end of this section, you'll be comfortable managing multiple processes at once using Linux job control techniques.

Daemon Processes

In this section, we’ll explain daemon processes—background services that start when the system boots and run continuously. We’ll cover their roles, such as handling network requests and managing services like sshd and apache2.

What Is Service on Linux?

In this topic, we'll clarify the concept of services in Linux. We'll explore how services are typically implemented as daemon processes, with examples like SSH and Apache services that run without direct user interaction.

Systemd

This section will introduce systemd, the system and service manager for Linux. We’ll explain how it initializes system services, manages processes, and interacts with other services during boot and runtime.

Unit File

In this section, we’ll explore unit files, which define services, targets, and other system components in systemd. We'll explain the structure of a unit file and how it manages system resources.

Systemctl Sub-Commands

We’ll cover the systemctl command, a powerful tool for controlling systemd services. We'll walk you through common systemctl sub-commands such as start, stop, enable, and disable, and how they are used to manage services in Linux.

Create Custom Unit and Start at Boot

This section will guide you through creating a custom unit file to run a service automatically at boot time. You'll learn how to enable a service and set up automatic startup for your custom services.

Firewall

In this topic, we’ll introduce firewalls in Linux and their role in securing network traffic. We'll show you how to use firewalls to block malicious traffic while allowing legitimate connections.

UFW (Uncomplicated Firewall)

We’ll demonstrate how to use UFW, a simple frontend for iptables. This section covers setting up basic firewall rules like allowing or blocking specific ports or IP addresses, as well as enabling and disabling UFW.

Web Server

In this section, we'll introduce web servers, specifically focusing on Apache and Nginx. You'll learn how to install, configure, and launch these servers to host websites on your Linux system.

Launch Apache Web Server

Finally, we’ll demonstrate how to launch an Apache web server on your Linux system. You’ll learn the steps to install, configure, and serve a simple webpage using Apache, and ensure the server is running securely.

Learn offline for better focus!
A book for this course is available on Amazon.

Linux Visual Guide

Step-By-Step Manual for Complete Beginners to Mastering Linux Basics, Vim Editor, Command Management, Remote Server Operation, and More.

Your browser does not support the video tag.
Get the Book Now

More Topics to Explore

How to Use Vim Editor for Text Editing on Linux

Chapter 3. Vim Editor

Creating and Editing Django Models

Create Django Models

Email Verification with Django Allauth: Console Method

Django Allauth (3) – Email Verification via Console

Introduction to Insert Mode in Vim Editor

Insert Mode

How to Use Cursor in Vim Editor Normal Mode

Normal Mode (1) – Move Cursor

How to Use Vim Editor for Text Editing on Linux

Chapter 3. Vim Editor

Creating and Editing Django Models

Create Django Models

Email Verification with Django Allauth: Console Method

Django Allauth (3) – Email Verification via Console

Introduction to Insert Mode in Vim Editor

Insert Mode

How to Use Cursor in Vim Editor Normal Mode

Normal Mode (1) – Move Cursor

Tags:

Process

Job

Service

Firewall

systemd

Linux Introduction
Course Content

Chapter 1. Linux Basics

What Is OS?

CUI and GUI

Linux Distributions

Package Manager

Kernel and Shell

Current Working Directory

Linux Directory Structure

Absolute Path and Relative Path (Linux OS)

Linux Command Syntax

Special Characters and Escape Character

Chapter 2. Linux Key Commands

Setting Up Linux Environment on AWS

pwd (Print Working Directory)

cd (Change Directory)

ls (List Contents of Directory)

mkdir (Make Directory)

rmdir (Remove Directory)

touch (Create File)

rm (Remove File)

mv (Move File and Directory)

cp (Copy File and Directory)

cat (Display File Content)

sort (Sort File Contents)

grep (Global Regular Expression Print)

Regular Expression

find (Find File and Directory)

Wildcard

ln (Create Link to File and Directory)

Chapter 3. Vim Editor

What Is Vim and How to Launch It?

Normal, Insert and Visual Mode

Normal Mode (1) – Move Cursor

Normal Mode (2) – Delete

Normal Mode (3) – Copy and Paste

Normal Mode (4) – Undo and Redo

Normal Mode (5) – Search Phrase

Normal Mode (6) – Replace Phrase

Normal Mode (7) – Save and Exit

Insert Mode

Visual Mode

Chapter 4. User, Group and Permission

What Are User, Group And Permission in Linux?

Permission (Access Mode) by Owner Status

Superuser (Root User) vs. Normal User

sudo (Run Command with Superuser Privileges)

su (Switch User)

useradd (Add User)

passwd (Set Password)

userdel (Delete User)

Group – Primary Group and Secondary Group

groupadd (Add Group)

usermod (Modify User Account Information)

gpasswd (Add and Delete Users to Group)

groupdel (Delete Group)

chown (Change Owner of File and Directory)

chgrp (Change Group of File and Directory)

chmod (Change Access Mode)

chmod Command with Numbers

w and who (Check Current User Login Status)

id and groups (Check User ID and Group)

getent (Display User and Group Data)

Chapter 5. Redirection, Pipe and Shell Script

Standard Input Output and Redirection

Pipe (Combine Commands)

less (Display Content with Pager)

tr (Replace Characters)

cut (Extract Data Sections)

uniq (Extract Unique Data Lines)

Shell Script

echo (Echo input)

read (Read and Store Input)

Shell Variable and Environmental Variable

source (Execute Shell Script and Refresh Environmental Variables)

Chapter 6. Linux Commands for Command Management

history (Check Command History)

alias (Create Command Shortcuts)

man (Display Manual)

type, which and whereis (Display Command Information)

Package Manager Command

tree (Display Directory Tree)

Chapter 7. SSH Remote Connection

SSH (Secure Shell)

Locate .ssh Directory

SSH Remote Login (1) – Use Key Pair Generated by Server

SSH Remote Login (2) – Use Key Pair Generated by Client

SSH Config File

SSH Remote Login with Visual Studio Code

SCP (Secure Copy Protocol)

SCP with SSH Config File

SFTP (Secure File Transfer Protocol)

Other File Transfer Commands

Chapter 8. Linux Process Management

Process and Job

Foreground and Background Jobs

jobs and ps (Display Jobs and Processes)

Signals

Create, Stop and Terminate Jobs

Daemon Processes

What Is Service on Linux?

Systemd

Unit File

Systemctl Sub-Commands

Create Custom Unit and Start at Boot

Firewall

UFW (Uncomplicated Firewall)

Web Server

Launch Apache Web Server

Chapter 1. Linux Basics

What Is OS?

CUI and GUI

Linux Distributions

Package Manager

Kernel and Shell

Current Working Directory

Linux Directory Structure

Absolute Path and Relative Path (Linux OS)

Linux Command Syntax

Special Characters and Escape Character

Chapter 2. Linux Key Commands

Setting Up Linux Environment on AWS

pwd (Print Working Directory)

cd (Change Directory)

ls (List Contents of Directory)

mkdir (Make Directory)

rmdir (Remove Directory)

touch (Create File)

rm (Remove File)

mv (Move File and Directory)

cp (Copy File and Directory)

cat (Display File Content)

sort (Sort File Contents)

grep (Global Regular Expression Print)

Regular Expression

find (Find File and Directory)

Wildcard

ln (Create Link to File and Directory)

Chapter 3. Vim Editor

What Is Vim and How to Launch It?

Normal, Insert and Visual Mode

Normal Mode (1) – Move Cursor

Normal Mode (2) – Delete

Normal Mode (3) – Copy and Paste

Normal Mode (4) – Undo and Redo

Normal Mode (5) – Search Phrase

Normal Mode (6) – Replace Phrase

Normal Mode (7) – Save and Exit

Insert Mode

Visual Mode

Chapter 4. User, Group and Permission

What Are User, Group And Permission in Linux?

Permission (Access Mode) by Owner Status

Superuser (Root User) vs. Normal User

sudo (Run Command with Superuser Privileges)

su (Switch User)

useradd (Add User)

passwd (Set Password)

userdel (Delete User)

Group – Primary Group and Secondary Group

groupadd (Add Group)

usermod (Modify User Account Information)

gpasswd (Add and Delete Users to Group)

groupdel (Delete Group)

chown (Change Owner of File and Directory)

chgrp (Change Group of File and Directory)

chmod (Change Access Mode)

chmod Command with Numbers

w and who (Check Current User Login Status)

id and groups (Check User ID and Group)

getent (Display User and Group Data)

Chapter 5. Redirection, Pipe and Shell Script

Standard Input Output and Redirection

Pipe (Combine Commands)

less (Display Content with Pager)

tr (Replace Characters)

cut (Extract Data Sections)

uniq (Extract Unique Data Lines)

Shell Script

echo (Echo input)

read (Read and Store Input)

Shell Variable and Environmental Variable

source (Execute Shell Script and Refresh Environmental Variables)

Chapter 6. Linux Commands for Command Management

history (Check Command History)

alias (Create Command Shortcuts)

man (Display Manual)

type, which and whereis (Display Command Information)

Package Manager Command

tree (Display Directory Tree)

Chapter 7. SSH Remote Connection

SSH (Secure Shell)

Locate .ssh Directory

SSH Remote Login (1) – Use Key Pair Generated by Server

SSH Remote Login (2) – Use Key Pair Generated by Client

SSH Config File

SSH Remote Login with Visual Studio Code

SCP (Secure Copy Protocol)

SCP with SSH Config File

SFTP (Secure File Transfer Protocol)

Other File Transfer Commands

Chapter 8. Linux Process Management

Process and Job

Foreground and Background Jobs

jobs and ps (Display Jobs and Processes)

Signals

Create, Stop and Terminate Jobs

Daemon Processes

What Is Service on Linux?

Systemd

Unit File

Systemctl Sub-Commands

Create Custom Unit and Start at Boot

Firewall

UFW (Uncomplicated Firewall)

Web Server

Launch Apache Web Server