Process

Synopsis

This module assists the users in handling a required process functions, and also to kill a process. The user can specify the particular process based on their requirements. The user can specify the name of the process, the file or directory either from local or in a remote machine. Let us see, the usage and methodologies involved in it.

Help Command

The help command serves the users regarding how to handle and to work with process as per their needs. It also lists out the alternative parameters of process. It describes the syntax for killing a process, and also about how to specify killing a process on the basis of their needs. The help command for process module is shown as below.

cleopatra process help

The following screenshot as shown below, depicts how to kill a process, and how to define killing a process.

How to define and to use the process

To kill a process the following syntax can be used.

cleopatra process kill

or

cleopatra process kill --yes --name="selenium" --use-psax # default

The syntax as shown above will looks for string in result of.

cleopatra process kill --yes --name="selenium" --use-pkill #

The syntax as shown above is used to specify or find a string which is to be killed.

cleopatra process kill --yes
                --guess
                id="1234 #

The command as shown above will kills a process as per the given id.

cleopatra process kill --yes
        --level #

The command as above is used to kill a process as per the specified level.

cleopatra process kill --yes --guess --name="skype"

The command as above is used to kill a process by specifying its name. The following screenshot depicts the working of killing a process.

Killing a process using a PID

If the PID # 3486 is assigned to the lighttpd process. To kill the lighttpd server, you need to pass a PID as follows:

# kill 3486

OR

$ sudo kill 3486

This will terminate a process with a PID of 3486.

How do I verify that the process is gone / killed?

Use the ps or pidof command:

$ ps aux | grep lighttpd
$ pidof lighttpd

How can I kill two or more PIDs?

The syntax is as follows to kill two or more PIDs as required can be used in a single command:

kill  pid1 pid2 pid3
kill -15  pid1 pid2 pid3
kill -9  pid1 pid2 pid3
kill  -9 3546 5557 4242

Say hello to kill all command

This is a Linux only command. to kill processes by name. So no need to find the PIDs using the ‘pidof process’ or ‘ps aux | grep process’ command. Do not use killall command on Unix operating systems. This is a Linux specific command.

The syntax is

killall Process-Name-Here

To kill the lighttpd server, enter:

# killall -15 lighttpd

OR .. code-block:: bash

# killall -9 lighttpd

To kill the Firefox web-browser process, enter:

# killall -9 firefox-bin

As I said earlier, the kill all command on UNIX-like system does something else. It kills all process and not just specific process. Do not use kill all on UNIX system.

Benefits

  • The user can kill a process using different parameters as per their requirements. For example: by using the id, level of the process it can be specified to kill.
comments powered by Disqus

Edit this document!

This file can be edited directly through the Web. Anyone can update and fix errors in this document with few clicks -- no downloads needed.

  1. Go to Process on GitHub.
  2. Edit files using GitHub's text editor in your web browser (see the 'Edit' tab on the top right of the file)
  3. Fill in the Commit message text box at the bottom of the page describing why you made the changes. Press the Propose file change button next to it when done.
  4. Then click Send a pull request.
  5. Your changes are now queued for review under the project's Pull requests tab on GitHub!

For an introduction to the documentation format please see the reST primer.