SlideShare a Scribd company logo
1 of 12
11-1
Day 4
gdfdgdfdh
fhfjdfhjgfh
gfgjdfhgjd
hffkkfjgkfj
11-2
Text Editors
--Mostly used editors in Linux are:
• vi
• pico
• nano
About VI editor:
Visual Interface is standard text editor that is supplied with most of the Unix
distributions.
In Linux environment, the vim text editor is used as a substitute for VI.
The Vim editor (VI iMproved) is upward compatible with vi editor
11-3
VI Editor
Starting vi
--The following sections describe how to start vi, type text in a file, save (write)
the file, and quit vi.
--Creating a File
Start vi and edit the file paint as shown in this example:
$ vi <file_name>
--If file name already exists, vi opens the existing file. If this is a new file, vi
creates it. For the purposes of this example, paint should be a new file.
--The vi editing screen appears in a moment:
--The cursor appears in the upper left corner of the screen. Blank lines are
indicated by a vertical series of tildes (~).
--Note that you can also start vi without specifying a file name by just typing vi.
You can then name the file later when you exit vi.
11-4
VI Editor
Status Line
The last line of the screen, called the status line, shows the name of the file
and the number of lines and characters in the file. When you create a new
file, as is the case with the example, the status line indicates that it is a new
file
11-5
VI Editor
Two Modes of vi editor
 Two modes of operation in vi are insert mode and command mode. You
use insert mode to type text into a file, while command mode is used to
type commands that perform specific vi functions. Command mode is the
default mode for vi.
 When you first open a vi file, it's always in command mode. Before you
can type text in the file, you must type one of the vi insert commands,
such as i ("insert"), to insert text at the current cursor location, or a
("append"), to insert text after the current cursor location.
 Whenever you want to return vi to command mode, press Esc. If you're
not sure which mode vi is presently in, simply press Esc to make sure it's
in command mode and continue from there.
11-6
VI Editor
• x - is for deleting
• u - is for Undo
• dd - is for removing of the line
• p - paste the cutting data below the
cursor line
• yy -for copying the data ( yanking)
• p - paste
• /keyword - to search for a keyword
• G - for end of the file
• :w - Save your data.
• :q - quitting.
• :wq - for Saving and quitting
• :q! - quitting without any changes
forcefully.
• h - go left ( arrow keys)
• l - go right
• j - go down
• k - go up
11-7
Process Management
- A process can be simply defined as an instance of a running program.
• each process will have a unique numeric identifier associated with it, referred 
to as its process identification number, or PID
• each process also has a reference to the PID of its parent, i.e. the parent 
process id, or PPID
• each process will have priorities associated with it, i.e. the priority of order of 
execution
-/proc = all the processes information
11-8
Process Management
Processes Information:
ps - command will give you the process information
ps -ef = will give you the complete information
EXAMPLES
To see every process on the system using standard syntax:
   ps -e
   ps –ef
To see every process on the system using BSD syntax:
   ps ax
   ps axu
To see every process except those running as root
   ps -U root -N
11-9
Terminate process
• Kill Command – Kill the process by specifying its PID
syn: kill <process_id> / kill -9 <process_id>
    Ex: kill 1000
       kill -9 1000
• Killall Command – Kill processes by name
syn: killall  <proces_name>
ex: killall  firefox
• Pkill Command – Send signal to the process based on its name
syn: pkill <process_name>
ex: pkill apache
11-10
Process Management
Zombie Process: On Unix operating systems, a zombie process or defunct
process is a process that has completed execution but still has an entry in the
process table.
• When a process ends, all of the memory and resources associated with it are
deallocated so they can be used by other processes.
• Zombies can be identified in the output from the Unix PS command by the
presence of a "Z" in the STAT column.
• To remove zombies from a system, the SIGCHLD signal can be sent to the
parent manually, using the kill command.
So how do I find out zombie process?
--Use top or ps command:
11-11
Process Management
Commands:
• top
• ps aux | grep –wi z
• kill -s SIGCHLD <ppid>
• kill -9 <pid>
--Please note that kill -9 does not guarantee to kill a zombie process
--If you have zombie processes it means those zombies have not been
waited for by their parent (look at PPID displayed by ps -l)
11-12

More Related Content

What's hot

Linux or Unix commands (commands for file creation)
Linux or Unix commands (commands for file creation)Linux or Unix commands (commands for file creation)
Linux or Unix commands (commands for file creation)Muhammad Jawwad Hashmi
 
Basic command ppt
Basic command pptBasic command ppt
Basic command pptRohit Kumar
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editorshanmuga rajan
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)Rodrigo Maia
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examplesabclearnn
 
linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014Peter Martin
 
Rakesh Kaushik
Rakesh KaushikRakesh Kaushik
Rakesh Kaushikitplant
 
Basic linux commands for bioinformatics
Basic linux commands for bioinformaticsBasic linux commands for bioinformatics
Basic linux commands for bioinformaticsBonnie Ng
 
Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)meashi
 
Unix Command Line Productivity Tips
Unix Command Line Productivity TipsUnix Command Line Productivity Tips
Unix Command Line Productivity TipsKeith Bennett
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filtersAcácio Oliveira
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginnersSuKyeong Jang
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbookWave Digitech
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic CommandsHanan Nmr
 

What's hot (20)

Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
 
Linux or Unix commands (commands for file creation)
Linux or Unix commands (commands for file creation)Linux or Unix commands (commands for file creation)
Linux or Unix commands (commands for file creation)
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
 
linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014
 
Rakesh Kaushik
Rakesh KaushikRakesh Kaushik
Rakesh Kaushik
 
Basic linux commands for bioinformatics
Basic linux commands for bioinformaticsBasic linux commands for bioinformatics
Basic linux commands for bioinformatics
 
Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)
 
Unix Command Line Productivity Tips
Unix Command Line Productivity TipsUnix Command Line Productivity Tips
Unix Command Line Productivity Tips
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 
Linux day 1
Linux day 1Linux day 1
Linux day 1
 
Basic
BasicBasic
Basic
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginners
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Know the UNIX Commands
Know the UNIX CommandsKnow the UNIX Commands
Know the UNIX Commands
 
Useful Linux and Unix commands handbook
Useful Linux and Unix commands handbookUseful Linux and Unix commands handbook
Useful Linux and Unix commands handbook
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 

Similar to Basic linux day 4

Similar to Basic linux day 4 (20)

Text editor In RHEL
Text editor In RHELText editor In RHEL
Text editor In RHEL
 
lectuer 21-22.pptx
lectuer 21-22.pptxlectuer 21-22.pptx
lectuer 21-22.pptx
 
Vi and redirection & piping in linux
Vi and redirection & piping in linuxVi and redirection & piping in linux
Vi and redirection & piping in linux
 
swl--3 (1).docx
swl--3 (1).docxswl--3 (1).docx
swl--3 (1).docx
 
Vi Editor
Vi EditorVi Editor
Vi Editor
 
Vi editor
Vi editorVi editor
Vi editor
 
andrew's guide to vim
andrew's guide to vimandrew's guide to vim
andrew's guide to vim
 
Vi editor in linux
Vi editor in linuxVi editor in linux
Vi editor in linux
 
02 linux desktop usage
02 linux desktop usage02 linux desktop usage
02 linux desktop usage
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Foss manual (1)
Foss manual (1)Foss manual (1)
Foss manual (1)
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linux13 concurrent versions system
Linux13 concurrent versions systemLinux13 concurrent versions system
Linux13 concurrent versions system
 
Terminal commands ubuntu 2
Terminal commands ubuntu 2Terminal commands ubuntu 2
Terminal commands ubuntu 2
 
Sandy Report
Sandy ReportSandy Report
Sandy Report
 
Sandy Report
Sandy ReportSandy Report
Sandy Report
 
Unix
UnixUnix
Unix
 
Chapter 1: Introduction to Command Line
Chapter 1: Introduction  to Command LineChapter 1: Introduction  to Command Line
Chapter 1: Introduction to Command Line
 
Unix commands
Unix commandsUnix commands
Unix commands
 

Recently uploaded

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
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
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 

Recently uploaded (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
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
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 

Basic linux day 4