14 March 2014

Basic Linux MCQ Questions for Beginners (Linux Processes) - Set 6

7 comments

linux Question and answer in linux
This is set 6 in the ongoing series of MCQ. Hope you have enjoyed the other parts of the series. In this set we will cover questions related to Linux processes as processes are fundamental part of the Linux system. So lets get started

1

What is ppid(parent process id) of daemon process in Linux ?

any arbitrary number

1

Answer
Option B is correct, As daemon process are initiated by init process(Pid is 1). You can see all your system daemon process by running following command
$ cd /etc/init.d && ls
See all your currently running daemon process by executing following command
$ ps -ef | awk '$3 == 1'

2

What is context switch?

Process switches from user mode to kernel mode

Process switches from kernel mode to user mode

Kernel switches from one process to another process

None of these

Answer
When kernel switches from one process to another process, then this process of switching is known as context switch. On context switch kernel save the state of the process, so when it switch back to that process, it can start it from the point it left it.

3

Maximum number of processes exist in Linux system ?

32768

1024

2048

16384

Answer
Option A is correct. Number of process in a Linux system depends upon the highest value that can be assigned to the process. By default in linux it is 32768. You can check it by running following command
$ cat cat /proc/sys/kernel/pid_max

4

Which of the following command keep a process running even after you logout from your shell?

&

nohup

bg

hup

Answer
nohup is a command which keeps your process running in background even after you logout from shell. Use nohup as follows
$ nohup process_name &
Note: & used to run process in background, so above process will run background and it will continue to do so even after you logout from system.

5

What is the range of nice number in linux system ?

0 to 19

-20 to 19

-20 to 0

-10 to 10

Answer
Option B is correct. In linux priority of a process is indicated by nice number ranges from -20 to +19. Lesser the value of nice, greater the priority of the process. You can see nice value of process by running following command.
$ ps -efl
Note: Field NI indicates the nice value of that process


6

On success fork return ______ to parent process ?

0

1

parent process id

child process Id

Answer
Option D is correct answer.

7

Which of the following command kill all the process including shell ?

kill kill 0

kill -9 kill 0

kill -s kill 0

Both B and C

Answer
Option D is correct.

8

Which of the following statement is true ?

echo $$ return PID of login shell and echo $? return status of last command

echo $$ return status of last command and echo $? return PID of login shell

echo $$ and echo $? return some integer value of no significance

All of the statements are false

Answer
Option A is true. $$ and $? are shell variables which return PID of login shell and status of last command respectively.
$ echo $$
$ echo $?

9

Priority of the process can be changed using which of the following command ?

nice

chpriority

renice

Not allowed to change process priority

Answer
Option C is correct. We can change process priority using renice command
$ renice -n nice_value -p process_id(s)

10

In _______ state of a process, the process will be terminated and the information will still be available in the process table.

Interruptible

Uninterruptible

Zombie

Running

Answer
option C is correct.
When process die it immediately moves to zombie state. It remains in this state until the parent picks up the child's exist status from the process table. A zombie process is a harmless dead child but you can't kill it. You can kill it by killing its parent process.

That's it. Let me know your suggestion and feedback in comment section.
Hope you Enjoyed the MCQ :)



If You Liked This Post Please Take a Time To Share This Post

You May Also Like...

7 comments:

  1. This is the inquiries and answers segment on Linux with clarification for different meeting, aggressive examination and passageway test. Explained illustrations with point by point answer depiction, clarification are given and it is straightforward.

    Kochi to munnar taxi

    ReplyDelete
  2. Questions on Linux was really very interesting to read about. i just loved the way author described each and everything in detail. thanks for sharing such an amazing post.
    Engineering Colleges In Chennai, Nautical Science Colleges In Chennai

    ReplyDelete
  3. Such a great info provided in this post. Keep providing useful post in this blog .I appreciate author for this specific valuable post. Culinary Schools in Dubai , International Centre for Culinary Arts

    ReplyDelete
  4. This blog is having the general information. Got a creative work and this is very different one.We have to develop our creativity mind.This blog helps for this. Thank you for this blog. This is very interesting and useful.

    Informatica Training in Chennai

    ReplyDelete
  5. Great post!I am actually getting ready to across this information,i am very happy to this commands.Also great blog here with all of the valuable information you have.Well done,its a great knowledge.

    AWS Training in Chennai

    ReplyDelete
  6. Great post! I am actually getting ready to across this information, It's very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.

    Fresher Jobs in Mumbai
    Fresher Jobs in Pune
    Fresher Jobs in Noida
    Fresher Jobs in Hyderabad

    ReplyDelete