Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Linux / Unix please as much as you can thanks Process management question: 1. De

ID: 3860619 • Letter: L

Question

Linux / Unix please as much as you can thanks

Process management question:

1. Describe the kill cmd briefly with an example.

I/O redirection questions:

1. To redirect error of find /usr/bin to a file in current directory named find.err and output to $HOME/find.out

2. To redirect output of cmd ps -ef to a file named /tmp/ps.out.$$

=============================================================

find questions: DO NOT USE ls or its recursive options

to find all regular files from your home directory

(0 points if you hard code your home directory)

Explanation / Answer

1)Answer:

Kill command:

The kill command is used on Linux and other Unix-like operating systems to terminateprocesses without having to log out or reboot (i.e., restart) the computer. Thus, it is particularly important to the stability of such systems.

A process, also referred to as a task, is an executing (i.e., running) instance of aprogram. Each process is automatically assigned a unique process identification number (PID) when it is created for use by the system to reference the process.

The syntax for kill is

kill [signal or option] PID(s)

The only argument (i.e., input) that is required is a PID, and as many PIDs as desired can be used in a single command. Typically no signal or option is used.

Thus, if it is desired to terminate a process with a PID of 485, the following will usually be sufficient:

kill 485

The kill command has a misleading name because it does not actually kill processes. Rather, it sends signals to them. Each process is supplied with a set of standard signal handlers by the operating system in order to deal with incoming signals. When no signal is explicitly included in the command, signal 15, named SIGTERM, is sent by default. If this fails, the stronger signal 9, called SIGKILL, should be used. For example, the following command would nearly guarantee that process 485 would be killed:

kill -9 485

The only situation in which signal 9 will fail is if the process is in the midst of making asystem call, which is a request to the kernel (i.e., the core of the operating system) for some action such as process creation. In this situation, the process will die once it has returned from the system call.

There are more than 60 signals that can be used with kill, but, fortunately, most users will only need to be aware of signal 9. The full list is contained in the file/usr/include/linux/signal.h and can be viewed by using kill with its -l option, i.e.,

kill -l

-kill is a command that is used in several popular operating systemsto send signals to running processes in order to request the termination of the process.

Examples:

kill examples

Kills all processes possible to be killed.

Translates signal number 11 into its signal name.

Lists the available signal choices in a tabular format.

Sends the default signal (TERM) to the processes with IDs 123, 543, 2341, and 3453, terminating those processes

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote