SlideShare a Scribd company logo
1 of 49
SYSTEM ADMIN
PROF. GAMBOA
PRAYER
Heavenly father we pray in Jesus’s name first to thank
you in advance for blessing our families near and far. I
ask that you continue to guide and teach me in all that I say
and do, and that I may do all according to your will. I ask
you to continue to pour our your bountiful blessings and
mercy on myself and my whole family. We thank you for
our health and our strong growing relationship in the
lord.
Amen.
INSTRUCTION FOR TODAY
• YOU CAN OPEN YOUR TERMUX OR UBUNTU TERMINAL
• TRY TO USE SOME OF THE COMMAND THAT I WILL SHOW ON THE SCREEN IN
OUR DEEP LEARNING.
• TAKE A SCREEN SHOT FOR THE OUTPUT THAT YOU WILL GET IN EVERY
COMMAND YOU PRACTICE RIGHT NOW.
• THIS IS SERVED AS YOUR SEATWORK ACTIVITY DURING OUR DEEP LEARNING
ACTIVITY.
Processes in Linux
A program/command when executed, a special instance is provided by the system to
the process. This instance consists of all the services/resources that may be utilized by
the process under execution.
 Whenever a command is issued in unix/linux, it creates/starts a new process. For
example, pwd when issued which is used to list the current directory location the
user is in, a process starts.
 Through a 5 digit ID number unix/linux keeps account of the processes, this
number is call process id or pid. Each process in the system has a unique pid.
 Used up pid’s can be used in again for a newer process since all the possible
combinations are used.
 At any point of time, no two processes with the same pid exist in the system
because it is the pid that Unix uses to track each process.
Initializing a process
A process can be run in two ways:
1.Foreground Process : Every process when started runs in foreground by
default, receives input from the keyboard and sends output to the screen.
When issuing pwd command
$ ls pwd
When a command/process is running in the foreground and is taking a lot
of time, no other processes can be run or started because the prompt
would not be available until the program finishes processing and comes
out.
Background Process : It runs in the background without keyboard
input and waits till keyboard input is required. Thus, other processes
can be done in parallel with the process running in background since
they do not have to wait for the previous process to be completed.
Adding & along with the command starts it as a background process
$ pwd &
Since pwd does not wants any input from the keyboard, it goes to the
stop state until moved to the foreground and given any data input. Thus,
on pressing Enter, :
Output:
[1] + Done pwd $
That first line contains information about the background process – the
job number and the process ID. It tells you that the ls command
background process finishes successfully. The se The second is a
prompt for another command.
Tracking ongoing processes
ps (Process status) can be used to see/list all the running
processes.
$ ps PID TTY TIME CMD 19 pts/1
00:00:00 sh 24 pts/1 00:00:00 ps
For more information -f (full) can be used along with
ps
$ ps –f UID PID PPID C STIME TTY TIME CMD 52471 19 1 0 07:20 pts/1
00:00:00f sh 52471 25 19 0 08:04 pts/1 00:00:00 ps -f
For a single process information, ps along with process id is used
$ ps 19 PID TTY TIME CMD 19 pts/1 00:00:00 sh
For a running program (named process) Pidof finds the
process id’s (pids)
Fields described by ps are described as:
UID: User ID that this process belongs to (the person running
it)
PID: Process ID
PPID: Parent process ID (the ID of the process that started it)
C: CPU utilization of process
STIME: Process start time
TTY: Terminal type associated with the process
TIME: CPU time taken by the process
CMD: The command that started this process
$ ps PID TTY TIME CMD 19 pts/1
00:00:00 sh 24 pts/1 00:00:00 ps
There are other options which can be used along with ps
command :
-a: Shows information about all users
-x: Shows information about processes without terminals
-u: Shows additional information like -f option
-e: Displays extended information
Stopping a process
When running in foreground, hitting Ctrl + c (interrupt character) will exit
the command. For processes running in background kill command can be
used if it’s pid is known.
If a process ignores a regular kill command, you can use kill -9 followed by
the process ID .
Other process commands:
bg: A job control command that resumes suspended jobs while keeping
them running in the background
bg %19
How Does Linux Identify Processes?
Because Linux is a multi-user system, meaning different users
can be running various programs on the system, each running
instance of a program must be identified uniquely by the kernel.
And a program is identified by its process ID (PID) as well as it’s
parent processes ID (PPID), therefore processes can further be
categorized into:
•Parent processes – these are processes that create other
processes during run-time.
•Child processes – these processes are created by other
processes during run-time.
The Init Process
Init process is the mother (parent) of all processes on the system, it’s the
first program that is executed when the Linux system boots up; it manages
all other processes on the system. It is started by the kernel itself, so in
principle it does not have a parent process.
The init process always has process ID of 1. It functions as an adoptive
parent for all orphaned processes.
You can use the pidof command to find the ID of a process:
Starting a Process in Linux
Once you run a command or program (for example cloudcmd –
CloudCommander), it will start a process in the system. You can start a
foreground (interactive) process as follows, it will be connected to the
terminal and a user can send input it:
Linux Background Jobs
To start a process in the background (non-interactive), use the & symbol, here,
the process doesn’t read input from a user until it’s moved to the foreground.
You can also send a process to the background by suspending it
using [Ctrl + Z], this will send the SIGSTOP signal to the process,
thus stopping its operations; it becomes idle:
States of a Process in Linux
During execution, a process changes from one state to another
depending on its environment/circumstances. In Linux, a process has
the following possible states:
•Running – here it’s either running (it is the current process in the
system) or it’s ready to run (it’s waiting to be assigned to one of the
CPUs).
•Waiting – in this state, a process is waiting for an event to occur or for
a system resource. Additionally, the kernel also differentiates between
two types of waiting processes; interruptible waiting processes – can be
interrupted by signals and uninterruptible waiting processes – are
waiting directly on hardware conditions and cannot be interrupted by
any event/signal.
•Stopped – in this state, a process has been stopped, usually by
receiving a signal. For instance, a process that is being debugged.
•Zombie – here, a process is dead, it has been halted but it’s still has
an entry in the process table.
How to View Active Processes in Linux
There are several Linux tools for viewing/listing running processes on
the system, the two traditional and well known
are ps and top commands:
1. ps Command
It displays information about a selection of the active processes on the
system as shown below:
2. top – System Monitoring Tool
top is a powerful tool that offers you a dynamic real-time view of a
running system as shown in the screenshot below:
3. glances – System Monitoring Tool
glances is a relatively new system monitoring tool with
advanced features:
SHOW YOUR WORK
1. Display of Top Command
In this example, it will show information
like tasks, memory, cpu and swap. Press ‘q‘ to quit window.
2. Sorting with -O (Uppercase Letter ‘O’).
Press (Shift+O) to Sort field via field letter, for example press ‘a‘ letter to
sort process with PID (Process ID).
Type any key to return to main top window with
sorted PID order as shown in below screen. Press
‘q‘ to quit exit the window.
3. Display Specific User Process
Use top command with ‘u‘ option will display specific User process
details.
4. Highlight Running Process in Top
Press ‘z‘ option in running top command will display running process in color
which may help you to identified running process easily.
5. Shows Absolute Path of Processes
Press ‘c‘ option in running top command, it will display
absolute path of running process.
6. Change Delay or Set ‘Screen Refresh Interval’ in Top
By default screen refresh interval is 3.0 seconds, same can be change pressing
‘d‘ option in running top command and change it as desired as shown below.
7. Kill running process with argument ‘k’
You can kill a process after finding PID of process by pressing ‘k‘ option in
running top command without exiting from top window as shown below.
8. Sort by CPU Utilisation
Press (Shift+P) to sort processes as
per CPU utilization. See screenshot below.
9. Renice a Process
You can use ‘r‘ option to change the priority of the process also called
Renice.
10. Save Top Command Results
To save the running top command results output to a file /root/.toprc use
the following command.
11. Getting Top Command Help
Press ‘h‘ option to obtain the top command help.
LS COMMAND
• LS –R
• LS –A
• LS –F
• LS -N
13 BASIC CAT COMMAND
• The cat (short for “concatenate“) command is one of the most frequently
used command in linux/unix like operating systems. Cat command allows
us to create single or multiple files, view contain of file, concatenate files
and redirect output in terminal or files. In this article, we are going to find
out handy use of cat commands with their examples in linux.
General Syntax
cat [OPTION] [FILE]...
1. Display Contents of File
In the below example, it will show contents of /etc/passwd file.
# cat /etc/passwd root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
narad:x:500:500::/home/narad:/bin/bash
2. View Contents of Multiple Files in terminal
In below example, it will display contents of test and test1 file in terminal.
# cat test test1 Hello everybody Hi world,
3. Create a File with Cat Command
We will create a file called test2 file with below command.
# cat >test2
Awaits input from user, type desired text and press CTRL+D (hold down Ctrl Key and type ‘d‘) to exit.
The text will be written in test2 file. You can see content of file with following cat command.
# cat test2 hello everyone, how do you do?
4. Use Cat Command with More & Less Options
If file having large number of content that won’t fit in output terminal and screen scrolls up very fast, we
can use parameters more and less with cat command as show above.
# cat song.txt | more # cat song.txt | less
5. Display Line Numbers in File
With -n option you could see the line numbers of a file song.txt in the
output terminal.
# cat -n song.txt
1 "Heal The World"
2 There's A Place In
3 Your Heart
4 And I Know That It Is Love
5 And This Place Could
6 Be Much
7 Brighter Than Tomorrow
8 And If You Really Try
9 You'll Find There's No Need
10 To Cry 11 In This Place You’
ll Feel
12 There's No Hurt Or Sorrow
System Administration: Linux Process

More Related Content

What's hot

Operating Systems: Processor Management
Operating Systems: Processor ManagementOperating Systems: Processor Management
Operating Systems: Processor ManagementDamian T. Gordon
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot processTeja Bheemanapally
 
Linux booting process!!
Linux booting process!!Linux booting process!!
Linux booting process!!sourav verma
 
14038356 installation-guide-of-centos-5
14038356 installation-guide-of-centos-514038356 installation-guide-of-centos-5
14038356 installation-guide-of-centos-5Hind Sahel
 
Servers and Processes: Behavior and Analysis
Servers and Processes: Behavior and AnalysisServers and Processes: Behavior and Analysis
Servers and Processes: Behavior and Analysisdreamwidth
 
Tmux Development Workflow
Tmux Development WorkflowTmux Development Workflow
Tmux Development Workflowjschembri
 
Installing TP-Link PS310U V2 on Windows 10
Installing TP-Link PS310U V2 on Windows 10Installing TP-Link PS310U V2 on Windows 10
Installing TP-Link PS310U V2 on Windows 10ASTRAPAY
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot processsagarpdalvi
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-adminbadamisri
 
Cisco be6000 solution
Cisco be6000 solutionCisco be6000 solution
Cisco be6000 solutionLirouter Li
 
An Insight into the Linux Booting Process
An Insight into the Linux Booting ProcessAn Insight into the Linux Booting Process
An Insight into the Linux Booting ProcessHardeep Bhurji
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linuxMazenetsolution
 
Operating Systems: Revision
Operating Systems: RevisionOperating Systems: Revision
Operating Systems: RevisionDamian T. Gordon
 
Linux boot process – explained
Linux boot process – explainedLinux boot process – explained
Linux boot process – explainedLinuxConcept
 

What's hot (20)

Operating Systems: Processor Management
Operating Systems: Processor ManagementOperating Systems: Processor Management
Operating Systems: Processor Management
 
Process management
Process managementProcess management
Process management
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
Linux booting process!!
Linux booting process!!Linux booting process!!
Linux booting process!!
 
Boot prom basics
Boot prom basicsBoot prom basics
Boot prom basics
 
14038356 installation-guide-of-centos-5
14038356 installation-guide-of-centos-514038356 installation-guide-of-centos-5
14038356 installation-guide-of-centos-5
 
Servers and Processes: Behavior and Analysis
Servers and Processes: Behavior and AnalysisServers and Processes: Behavior and Analysis
Servers and Processes: Behavior and Analysis
 
Tmux Development Workflow
Tmux Development WorkflowTmux Development Workflow
Tmux Development Workflow
 
Installing TP-Link PS310U V2 on Windows 10
Installing TP-Link PS310U V2 on Windows 10Installing TP-Link PS310U V2 on Windows 10
Installing TP-Link PS310U V2 on Windows 10
 
Linux startup
Linux startupLinux startup
Linux startup
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-admin
 
Cisco be6000 solution
Cisco be6000 solutionCisco be6000 solution
Cisco be6000 solution
 
Linux Booting Process
Linux Booting ProcessLinux Booting Process
Linux Booting Process
 
snortinstallguide
snortinstallguidesnortinstallguide
snortinstallguide
 
An Insight into the Linux Booting Process
An Insight into the Linux Booting ProcessAn Insight into the Linux Booting Process
An Insight into the Linux Booting Process
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linux
 
Operating Systems: Revision
Operating Systems: RevisionOperating Systems: Revision
Operating Systems: Revision
 
Linux boot process – explained
Linux boot process – explainedLinux boot process – explained
Linux boot process – explained
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 

Similar to System Administration: Linux Process

Managing Processes in Unix.pptx
Managing Processes in Unix.pptxManaging Processes in Unix.pptx
Managing Processes in Unix.pptxHarsha Patel
 
Managing Processes in Unix.pptx
Managing Processes in Unix.pptxManaging Processes in Unix.pptx
Managing Processes in Unix.pptxHarsha Patel
 
Tarea - 3 Actividad intermedia trabajo colaborativo 2
Tarea - 3 Actividad intermedia trabajo colaborativo 2Tarea - 3 Actividad intermedia trabajo colaborativo 2
Tarea - 3 Actividad intermedia trabajo colaborativo 2HectorFabianPintoOsp
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevelsJohn Ombagi
 
Processes And Job Control
Processes And Job ControlProcesses And Job Control
Processes And Job Controlahmad bassiouny
 
PENETRATION TESTING INFORMATION GATHERING.ppt
PENETRATION TESTING INFORMATION GATHERING.pptPENETRATION TESTING INFORMATION GATHERING.ppt
PENETRATION TESTING INFORMATION GATHERING.pptjospinjj
 
Operating System 3
Operating System 3Operating System 3
Operating System 3tech2click
 
Operating System Practice : Meeting 5- process and manajemen proces-a-slide
Operating System Practice : Meeting 5- process and manajemen proces-a-slideOperating System Practice : Meeting 5- process and manajemen proces-a-slide
Operating System Practice : Meeting 5- process and manajemen proces-a-slideSyaiful Ahdan
 
13 process management
13 process management13 process management
13 process managementShay Cohen
 
intro unix/linux 10
intro unix/linux 10intro unix/linux 10
intro unix/linux 10duquoi
 
unix- the process states, zombies, running jobs in background
unix-  the process states, zombies, running jobs in backgroundunix-  the process states, zombies, running jobs in background
unix- the process states, zombies, running jobs in backgroundDr. Girish GS
 
Operating System Practice : Meeting 6- process and manajemen proces-b-slide
Operating System Practice : Meeting 6- process and manajemen proces-b-slideOperating System Practice : Meeting 6- process and manajemen proces-b-slide
Operating System Practice : Meeting 6- process and manajemen proces-b-slideSyaiful Ahdan
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxstilliegeorgiana
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxdenneymargareta
 

Similar to System Administration: Linux Process (20)

LP-Unit3.docx
LP-Unit3.docxLP-Unit3.docx
LP-Unit3.docx
 
UNIX Notes
UNIX NotesUNIX Notes
UNIX Notes
 
Process managment
Process  managmentProcess  managment
Process managment
 
Managing Processes in Unix.pptx
Managing Processes in Unix.pptxManaging Processes in Unix.pptx
Managing Processes in Unix.pptx
 
Managing Processes in Unix.pptx
Managing Processes in Unix.pptxManaging Processes in Unix.pptx
Managing Processes in Unix.pptx
 
Tarea - 3 Actividad intermedia trabajo colaborativo 2
Tarea - 3 Actividad intermedia trabajo colaborativo 2Tarea - 3 Actividad intermedia trabajo colaborativo 2
Tarea - 3 Actividad intermedia trabajo colaborativo 2
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevels
 
Process
ProcessProcess
Process
 
Processes And Job Control
Processes And Job ControlProcesses And Job Control
Processes And Job Control
 
PENETRATION TESTING INFORMATION GATHERING.ppt
PENETRATION TESTING INFORMATION GATHERING.pptPENETRATION TESTING INFORMATION GATHERING.ppt
PENETRATION TESTING INFORMATION GATHERING.ppt
 
Operating System 3
Operating System 3Operating System 3
Operating System 3
 
Operating System Practice : Meeting 5- process and manajemen proces-a-slide
Operating System Practice : Meeting 5- process and manajemen proces-a-slideOperating System Practice : Meeting 5- process and manajemen proces-a-slide
Operating System Practice : Meeting 5- process and manajemen proces-a-slide
 
Operating Systems
Operating Systems Operating Systems
Operating Systems
 
OS (1).pptx
OS (1).pptxOS (1).pptx
OS (1).pptx
 
13 process management
13 process management13 process management
13 process management
 
intro unix/linux 10
intro unix/linux 10intro unix/linux 10
intro unix/linux 10
 
unix- the process states, zombies, running jobs in background
unix-  the process states, zombies, running jobs in backgroundunix-  the process states, zombies, running jobs in background
unix- the process states, zombies, running jobs in background
 
Operating System Practice : Meeting 6- process and manajemen proces-b-slide
Operating System Practice : Meeting 6- process and manajemen proces-b-slideOperating System Practice : Meeting 6- process and manajemen proces-b-slide
Operating System Practice : Meeting 6- process and manajemen proces-b-slide
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docx
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docx
 

Recently uploaded

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 

System Administration: Linux Process

  • 2. PRAYER Heavenly father we pray in Jesus’s name first to thank you in advance for blessing our families near and far. I ask that you continue to guide and teach me in all that I say and do, and that I may do all according to your will. I ask you to continue to pour our your bountiful blessings and mercy on myself and my whole family. We thank you for our health and our strong growing relationship in the lord. Amen.
  • 3. INSTRUCTION FOR TODAY • YOU CAN OPEN YOUR TERMUX OR UBUNTU TERMINAL • TRY TO USE SOME OF THE COMMAND THAT I WILL SHOW ON THE SCREEN IN OUR DEEP LEARNING. • TAKE A SCREEN SHOT FOR THE OUTPUT THAT YOU WILL GET IN EVERY COMMAND YOU PRACTICE RIGHT NOW. • THIS IS SERVED AS YOUR SEATWORK ACTIVITY DURING OUR DEEP LEARNING ACTIVITY.
  • 4. Processes in Linux A program/command when executed, a special instance is provided by the system to the process. This instance consists of all the services/resources that may be utilized by the process under execution.  Whenever a command is issued in unix/linux, it creates/starts a new process. For example, pwd when issued which is used to list the current directory location the user is in, a process starts.  Through a 5 digit ID number unix/linux keeps account of the processes, this number is call process id or pid. Each process in the system has a unique pid.  Used up pid’s can be used in again for a newer process since all the possible combinations are used.  At any point of time, no two processes with the same pid exist in the system because it is the pid that Unix uses to track each process.
  • 5. Initializing a process A process can be run in two ways: 1.Foreground Process : Every process when started runs in foreground by default, receives input from the keyboard and sends output to the screen. When issuing pwd command $ ls pwd When a command/process is running in the foreground and is taking a lot of time, no other processes can be run or started because the prompt would not be available until the program finishes processing and comes out.
  • 6. Background Process : It runs in the background without keyboard input and waits till keyboard input is required. Thus, other processes can be done in parallel with the process running in background since they do not have to wait for the previous process to be completed. Adding & along with the command starts it as a background process $ pwd & Since pwd does not wants any input from the keyboard, it goes to the stop state until moved to the foreground and given any data input. Thus, on pressing Enter, : Output: [1] + Done pwd $
  • 7. That first line contains information about the background process – the job number and the process ID. It tells you that the ls command background process finishes successfully. The se The second is a prompt for another command. Tracking ongoing processes ps (Process status) can be used to see/list all the running processes. $ ps PID TTY TIME CMD 19 pts/1 00:00:00 sh 24 pts/1 00:00:00 ps
  • 8. For more information -f (full) can be used along with ps $ ps –f UID PID PPID C STIME TTY TIME CMD 52471 19 1 0 07:20 pts/1 00:00:00f sh 52471 25 19 0 08:04 pts/1 00:00:00 ps -f For a single process information, ps along with process id is used $ ps 19 PID TTY TIME CMD 19 pts/1 00:00:00 sh
  • 9. For a running program (named process) Pidof finds the process id’s (pids) Fields described by ps are described as: UID: User ID that this process belongs to (the person running it) PID: Process ID PPID: Parent process ID (the ID of the process that started it) C: CPU utilization of process STIME: Process start time TTY: Terminal type associated with the process TIME: CPU time taken by the process CMD: The command that started this process $ ps PID TTY TIME CMD 19 pts/1 00:00:00 sh 24 pts/1 00:00:00 ps
  • 10. There are other options which can be used along with ps command : -a: Shows information about all users -x: Shows information about processes without terminals -u: Shows additional information like -f option -e: Displays extended information
  • 11. Stopping a process When running in foreground, hitting Ctrl + c (interrupt character) will exit the command. For processes running in background kill command can be used if it’s pid is known.
  • 12. If a process ignores a regular kill command, you can use kill -9 followed by the process ID .
  • 13. Other process commands: bg: A job control command that resumes suspended jobs while keeping them running in the background bg %19
  • 14.
  • 15.
  • 16.
  • 17.
  • 18. How Does Linux Identify Processes?
  • 19. Because Linux is a multi-user system, meaning different users can be running various programs on the system, each running instance of a program must be identified uniquely by the kernel. And a program is identified by its process ID (PID) as well as it’s parent processes ID (PPID), therefore processes can further be categorized into: •Parent processes – these are processes that create other processes during run-time. •Child processes – these processes are created by other processes during run-time.
  • 20. The Init Process Init process is the mother (parent) of all processes on the system, it’s the first program that is executed when the Linux system boots up; it manages all other processes on the system. It is started by the kernel itself, so in principle it does not have a parent process. The init process always has process ID of 1. It functions as an adoptive parent for all orphaned processes. You can use the pidof command to find the ID of a process:
  • 21.
  • 22. Starting a Process in Linux Once you run a command or program (for example cloudcmd – CloudCommander), it will start a process in the system. You can start a foreground (interactive) process as follows, it will be connected to the terminal and a user can send input it:
  • 23. Linux Background Jobs To start a process in the background (non-interactive), use the & symbol, here, the process doesn’t read input from a user until it’s moved to the foreground.
  • 24. You can also send a process to the background by suspending it using [Ctrl + Z], this will send the SIGSTOP signal to the process, thus stopping its operations; it becomes idle:
  • 25.
  • 26. States of a Process in Linux During execution, a process changes from one state to another depending on its environment/circumstances. In Linux, a process has the following possible states: •Running – here it’s either running (it is the current process in the system) or it’s ready to run (it’s waiting to be assigned to one of the CPUs). •Waiting – in this state, a process is waiting for an event to occur or for a system resource. Additionally, the kernel also differentiates between two types of waiting processes; interruptible waiting processes – can be interrupted by signals and uninterruptible waiting processes – are waiting directly on hardware conditions and cannot be interrupted by any event/signal. •Stopped – in this state, a process has been stopped, usually by receiving a signal. For instance, a process that is being debugged. •Zombie – here, a process is dead, it has been halted but it’s still has an entry in the process table.
  • 27. How to View Active Processes in Linux There are several Linux tools for viewing/listing running processes on the system, the two traditional and well known are ps and top commands: 1. ps Command It displays information about a selection of the active processes on the system as shown below:
  • 28. 2. top – System Monitoring Tool top is a powerful tool that offers you a dynamic real-time view of a running system as shown in the screenshot below:
  • 29. 3. glances – System Monitoring Tool glances is a relatively new system monitoring tool with advanced features:
  • 31.
  • 32. 1. Display of Top Command In this example, it will show information like tasks, memory, cpu and swap. Press ‘q‘ to quit window.
  • 33. 2. Sorting with -O (Uppercase Letter ‘O’). Press (Shift+O) to Sort field via field letter, for example press ‘a‘ letter to sort process with PID (Process ID).
  • 34. Type any key to return to main top window with sorted PID order as shown in below screen. Press ‘q‘ to quit exit the window.
  • 35. 3. Display Specific User Process Use top command with ‘u‘ option will display specific User process details.
  • 36. 4. Highlight Running Process in Top Press ‘z‘ option in running top command will display running process in color which may help you to identified running process easily.
  • 37. 5. Shows Absolute Path of Processes Press ‘c‘ option in running top command, it will display absolute path of running process.
  • 38. 6. Change Delay or Set ‘Screen Refresh Interval’ in Top By default screen refresh interval is 3.0 seconds, same can be change pressing ‘d‘ option in running top command and change it as desired as shown below.
  • 39. 7. Kill running process with argument ‘k’ You can kill a process after finding PID of process by pressing ‘k‘ option in running top command without exiting from top window as shown below.
  • 40. 8. Sort by CPU Utilisation Press (Shift+P) to sort processes as per CPU utilization. See screenshot below.
  • 41. 9. Renice a Process You can use ‘r‘ option to change the priority of the process also called Renice.
  • 42. 10. Save Top Command Results To save the running top command results output to a file /root/.toprc use the following command.
  • 43. 11. Getting Top Command Help Press ‘h‘ option to obtain the top command help.
  • 44. LS COMMAND • LS –R • LS –A • LS –F • LS -N
  • 45. 13 BASIC CAT COMMAND • The cat (short for “concatenate“) command is one of the most frequently used command in linux/unix like operating systems. Cat command allows us to create single or multiple files, view contain of file, concatenate files and redirect output in terminal or files. In this article, we are going to find out handy use of cat commands with their examples in linux.
  • 46. General Syntax cat [OPTION] [FILE]... 1. Display Contents of File In the below example, it will show contents of /etc/passwd file. # cat /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin narad:x:500:500::/home/narad:/bin/bash 2. View Contents of Multiple Files in terminal In below example, it will display contents of test and test1 file in terminal. # cat test test1 Hello everybody Hi world,
  • 47. 3. Create a File with Cat Command We will create a file called test2 file with below command. # cat >test2 Awaits input from user, type desired text and press CTRL+D (hold down Ctrl Key and type ‘d‘) to exit. The text will be written in test2 file. You can see content of file with following cat command. # cat test2 hello everyone, how do you do? 4. Use Cat Command with More & Less Options If file having large number of content that won’t fit in output terminal and screen scrolls up very fast, we can use parameters more and less with cat command as show above. # cat song.txt | more # cat song.txt | less
  • 48. 5. Display Line Numbers in File With -n option you could see the line numbers of a file song.txt in the output terminal. # cat -n song.txt 1 "Heal The World" 2 There's A Place In 3 Your Heart 4 And I Know That It Is Love 5 And This Place Could 6 Be Much 7 Brighter Than Tomorrow 8 And If You Really Try 9 You'll Find There's No Need 10 To Cry 11 In This Place You’ ll Feel 12 There's No Hurt Or Sorrow