28 June 2013

Basic Linux MCQ Questions for Beginners - Set 3

1 comment

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

1

Total no of run levels in a Linux system?

6

7

5

8

Answer
Total number of run level in Linux system is 7 i.e from 0 to 6.
0 = Halt
1 = Single User
2 = Multiuser without NFS
3 = Multiuser
4 = User defined
5 = Multiuser with X
6 = Reboot

2

Which command is used to copy entire directory?

cp -r

cp -i

cp

none of these

Answer
cp -r is used to copy entire directory. Here r means recursive
$ cp -r [directory_to_be_copied] [new_direcotry]

3

Suppose I am in /etc directory and I want to go to my home directory which command should I use?

cd

cd ~

Both A and B

none of these

Answer
Option C is correct. You can use both command to move to your home directory from anywhere in the file system.

4

Which special character should be avoided during naming a file?

.(dot)

$

_(underscore)

-(Hyphen)

Answer
-(Hyphen) Should be avoided during naming a file. The reason is the command that uses this file name often treat it as an option and report an error. Ex suppose you named a file -new, when you cat this file using cat -new, cat command treat it as an option, it found it irrelevant and report an error.

5

Which of the following is relative path to /home/sandeep directory?

$ cd Desktop/abc

$ cd Downloads/abc

Both a and b

$ cd /etc

Answer
Option c is correct. Absolute path always starts from /.

6

Suppose currently I am in /home/sandeep/Downloads/abc. After executing cd ../.., where am I now?

/home/sandeep

/home/sandeep/Downloads

/home

None of these

Answer
cd ../.. means moving two directory up. After moving two directory up, we are at /home/sandeep.

7

Suppose I am in /etc directoy, after executing cd .(single dot), where am I now?

/etc

/(root)

/home

None of these

Answer
Option a is correct. .(single dot) means current directory, so after executing cd . we are not going anywhere.

8

what is the purpose of -i in rm -i command?

It will ask for confirmation before every deletion.

It just an extra option

Answer
Option a is correct

9

mv command can be used to ?

Move the file to different directory.

Renaming a file

Both a and b.

Only a.

Answer
Option c is correct statement about mv command

10

Which of the following command is used to display content of a file in octal format?

octal

cat

oct

od

Answer
option D is correct. od is used to display file in octal format.

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...

1 comment:

  1. Oh great post.It will be a great helpful questions for the linux beginner.Thank you this valuable post.All your post are really great.I just love the way of presenting every post.
    best essay writing service

    ReplyDelete