Processes
• A process is created every time you issue a command. It is
an instance of a running program.
• Question: What is an instance? (Think programming)
• A running process may spawn child processes
• e.g., a man process may invoke your default pager, thereby spawning a more process.
• The command ps will let you see all of your running processes. Some useful
options include:
• -e – lets you see information about all running processes, even those that are not yours.
• -f – displays more detailed information
Processes
• A interactive process launched by the shell that is not a daemon is called a
job.
• Child processes would not be jobs
• Question: What is a daemon?
• To see your running jobs, issue the jobs command.
Jobs
• There are two was to run processes/jobs in the background:
1. Start the job as you normally would. Suspend the job. Tell the system to
run the suspended job in the background; e.g.,
• man sort
• CTRL^Z
• Bg
2. Start the job in the background using the
ampersand:
• man sort &
• Question: Which of these is a command line command and why?
Running processes/jobs in the background
• To foreground your most recently suspended or backgrounded job, type fg
• To foreground another job:
• Determine its job number, via the jobs command
• Suppose you were interested in foregrounding job number 3. You would then issue the
command:
fg %3
Foregrounding a job
• To kill a process:
kill –SIGKILL processID or kill –s 9 processID
• To kill a job:
 kill –SIGKILL %job-number
**Note the percent symbol!**
• To kill all processes by name rather than process ID:
kill –SIGKILL name
For example: kill –SIGKILL man will all instances of the man command as well as any
child processes
Killing jobs and processes

Processes

  • 1.
  • 2.
    • A processis created every time you issue a command. It is an instance of a running program. • Question: What is an instance? (Think programming) • A running process may spawn child processes • e.g., a man process may invoke your default pager, thereby spawning a more process. • The command ps will let you see all of your running processes. Some useful options include: • -e – lets you see information about all running processes, even those that are not yours. • -f – displays more detailed information Processes
  • 3.
    • A interactiveprocess launched by the shell that is not a daemon is called a job. • Child processes would not be jobs • Question: What is a daemon? • To see your running jobs, issue the jobs command. Jobs
  • 4.
    • There aretwo was to run processes/jobs in the background: 1. Start the job as you normally would. Suspend the job. Tell the system to run the suspended job in the background; e.g., • man sort • CTRL^Z • Bg 2. Start the job in the background using the ampersand: • man sort & • Question: Which of these is a command line command and why? Running processes/jobs in the background
  • 5.
    • To foregroundyour most recently suspended or backgrounded job, type fg • To foreground another job: • Determine its job number, via the jobs command • Suppose you were interested in foregrounding job number 3. You would then issue the command: fg %3 Foregrounding a job
  • 6.
    • To killa process: kill –SIGKILL processID or kill –s 9 processID • To kill a job:  kill –SIGKILL %job-number **Note the percent symbol!** • To kill all processes by name rather than process ID: kill –SIGKILL name For example: kill –SIGKILL man will all instances of the man command as well as any child processes Killing jobs and processes