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

jobs and ps (Display Jobs and Processes)

jobs and ps (Display Jobs and Processes)

Display Jobs and Processes

The jobs command is used to check running jobs while the ps command is used to check running processes.

Check running jobs – jobs

The jobs command shows the job ID, status of each job (running, stopped, done, terminated), and job name. There is also the + or - symbol after job numbers. + refers to the current job and - refers to the previous job.

Command Line - INPUT
jobs
Command Line - RESPONSE
[1]   Running                 ./loop.sh > countdown_bg.txt &
[2]+  Stopped                 ./loop.sh > countdown_bg.txt
[3]   Running                 ./loop.sh > countdown_bg.txt &
[4]-  Running                 ./loop.sh > countdown_bg.txt &

-l option

If you want to show the process number, use the -l option.

Command Line - INPUT
jobs -l
Command Line - RESPONSE
[1]  85945 Running                 ./loop.sh > countdown_bg.txt &
[2]+ 85946 Stopped                 ./loop.sh > countdown_bg.txt
[3]  85947 Running                 ./loop.sh > countdown_bg.txt &
[4]- 85949 Running                 ./loop.sh > countdown_bg.txt &

Check running processes – ps

The ps command shows running processes initiated by the terminal. The process information includes PID (process ID), TTY (terminal name), TIME (processing time), and CMD (command name).

Command Line - INPUT
ps
Command Line - RESPONSE
    PID TTY          TIME CMD
  85871 pts/2    00:00:00 bash
  85945 pts/2    00:00:41 loop.sh
  85946 pts/2    00:00:11 loop.sh
  85947 pts/2    00:00:22 loop.sh
  85949 pts/2    00:00:11 loop.sh
  85950 pts/2    00:00:00 ps

-e option

The ps command shows the running processes that your terminal has initiated. The command doesn't show all the processes running on your computer. For example, processes initiated by the computer itself or initiated by other terminals are not shown. To display all the processes running on the computer, use the -e option.

Command Line - INPUT
ps -e
Command Line - RESPONSE
    PID TTY          TIME CMD
      1 ?        00:00:30 systemd
      2 ?        00:00:00 kthreadd
      3 ?        00:00:00 rcu_gp
    :
  85947 pts/2    00:00:37 loop.sh
  85949 pts/2    00:00:25 loop.sh
  85952 pts/2    00:00:00 ps

There are processes with ? in the TTY field. This means the process is initiated by the computer itself and is not a job initiated by a user.


You can also learn this topic offline. Click AmazonKindle.

More Topics to Explore

How Django Manages HTTP Requests and Responses

How Django Handles HTTP Request and HTTP Response

Managing Processes in Linux

Chapter 8. Linux Process Management

Viewing File Contents with cat Command

cat (Display File Content)

Understanding the .gitignore File in Git Projects

Project Initiator – .gitignore File

Managing Resources Between Local and Remote Servers

Manage Local Computer and Remote Server Simultaneously

How Django Manages HTTP Requests and Responses

How Django Handles HTTP Request and HTTP Response

Managing Processes in Linux

Chapter 8. Linux Process Management

Viewing File Contents with cat Command

cat (Display File Content)

Understanding the .gitignore File in Git Projects

Project Initiator – .gitignore File

Managing Resources Between Local and Remote Servers

Manage Local Computer and Remote Server Simultaneously

Tags:

Job

Foreground Job

Background Job

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