Sunday, March 24, 2019


Part – 3: -
Kill Command: -
Q) What is kill command ?
Ans – This command is used to kill a process or sends some signal to a process.
Kill –s SignalName PID<Enter – Key>
Or
Kill –n PID<Enter – Key>
Where n – Signal Number
PID – Process id of the process which need to be kill
Q) What are the signal numbers and signal name ?
Ans –
Signal Number
Signal Name
Full Signal Name
1
HUP
Hang Up
2
INT
Interrupt
3
QUIT
Quit
6
ABRT
Abort
8
KILL
Temporarily Kill
9
KILL
Forcibly Kill
15
TERM
Termination

Q) How to kill a process having process id 1543 ?
Ans - $ kill -9 1543<Enter – Key>
Or
Kill –s KILL 1543<Enter – Key>
Q) How to kill a process having process name start_busy.sh ?
Ans - $ ps –ef | grep start_busy.sh<Enter – Key>
Here the 2nd Field Value is the PID of the process.
$ kill -9 PID<Enter – Key>
Q) How to get process name from PID ?
Ans - $ ps –p PID<Enter – Key>
Q) How to get PID from process name ?
Ans - $ pgrep processName<Enter – Key>
Q) What is Zombie Process ?
Ans – When we send any request to shell, the shell calls a fork system call to create a child shell and assign that request to him. It is the responsibility of the child shell to complete the request and sends response back to parent shell. While sending back the response, if parent shell is not available to receive it, then it will keep the response in the result queue and die. Once the parent shell is available, it will search the result queue, take the response or result and display it. The time taken the child dies and parent shell gets the response, then the process will be in zombie state.
Q) What is orphan process ?
Ans – If parent dies before child finishes it tasks, then the process is called as orphan process.
Here init is the parent process whose PID = 1.

Part – 4: -
Q) How to get last boot timeof the Unix OS ?
Ans - $ who –b<Enter – Key>
Q) How much time the system is up or running and also its load average ?
Ans - $ uptime<Enter – Key>
Q) How to get memory related information ?
Ans - $ cat /proc/meminfo<Enter – Key>
Q) How to get how many CPU or processeors are connected to the Unix OS ?
Ans - $ cat /proc/cpuinfo<Enter – Key>

No comments:

Post a Comment

Interview Questions: - (UNIX - 0) UNIX: -   Q) How to get inode number of a file/directory? Ans – $ ls –i <File/Directory_Name...