25 June 2013

Basic Linux MCQ Questions for Beginners- Set 2

3 comments

linux Question and answer in linux
This is set 2 in the series of MCQ. Hope you enjoyed the first part of the series. Like first set, this set also contain some basic Linux questions and answers for beginners.

1

Which of the following is not a valid login shell in Linux?

C shell

Net Shell

Bash Shell

Z shell

Answer
Net shell does not exist in Linux or it is not a valid login shell. You can check all the shell available in your system by typing following command
$ cat /etc/shells

2

Which command is used to record session in Linux?

script

session

both a and b

none of these

Answer
script command is used to record session in Linux, exit command is used to exit the session. To record a session type following command(if you do not specify any file name with the session command then the default file will be typescript)
$ script
$ script session.lst

3

Which of the following command can be used as an alternative to echo command?

print

printr

printf

none of these

Answer
printf can be used as an alternative to echo command to print anything on the terminal.

4

Which command is used to change password of your Linux system?

password

pass

change -p

passwd

Answer
passwd command is used to change password of your Linux system.

5

Which command is used see the list of users who are currently logged-in?

login

users

who

which

Answer
who command is used to see list of user who are currently logged-in.

6

Which directory in Linux contains all the config file of the system?

/etc

/var

/lib

/bin

Answer
etc directory contains all the configuration files of the system.

7

Which of the following command is used to know last shutdown/reboot date and time?

last

lastlogin

lastreboot

lastshutdown

Answer
last command is used to know date and time of last shutdown/reboot.

8

Which of the following command is used to count number of lines in a file?

wc -l

wc -c

wc -w

None of these

Answer
wc -l command is used to count no of line is a file. Type following command to count no of lines in a file
$ wc -l < [filename]


9

Which of the following statement is incorrect about /bin and /sbin directory?

/sbin contain only binaries essential for booting, restoring,
recovering, and/or repairing the system in addition to the binaries in /bin.

There is no difference between /bin and /sbin, they are just two directories

/bin contains commands that may be used by both the system administrator and by users, but which are required when no other filesystems are mounted.

Utilities used for system administration are stored in /sbin.

Answer
Option b is incorrect statement about /bin and /sbin

10

Which of the following command(s) is/are used to reboot a Linux system?

shutdown -h

reboot

init 6

All of the above

Answer
option D is correct. All of the above command can be used to restart a Linux system.

That's it.
Hope you Enjoyed the MCQ :)


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

You May Also Like...

3 comments:

  1. sandeep this mcq form is very fine.. i wanna do something like this for my educational purpose.. i tried google forms but there are no options to show whether the answer right or wrong.. did you write it yourself ? can u give me some tips to do?

    ReplyDelete
    Replies
    1. First of all thanku for your appreciation :) . I have used jquery to form this mcq. Initially i have hidden the answer, but when user hover over answer box then it is visible. I have used radio button with id right and wrong, whenever user click on radio button with id=right, thumbs up image is shown and if he/she select wrong answer then thumbs down image is shown using jquery. That's how i made it.

      Delete
  2. Thank you sooo much...

    This really helped!

    ReplyDelete