BSCIT – SEM V Linux System Administration MCQ

1. Which of the following is not a type of shell?

A. The Shell B. The Korn Shell C. The D. The Perl Shell

2. Which of the following is true about shell?

A. A Shell provides you with an interface to the Unix system. B. Shell gathers input from you and executes programs based on that input. C. Shell is an environment in which we can run our commands, programs, and shell scripts. D. All of the above

3. What will be the output of $date?

A. Yesterday date B. Current date C. Current date and time D. Tomarrow date and time

4. The original was written in the mid ______.

A. 1960s B. 1970s C. 1980s D. 1990s

5. The original Unix shell was written by ______.

A. Stephen R. Bourne B. Stephen R. Korn C. Stephen R. C. D. Stephen Watson

6. On a UNIX system, there can be ____ shells running simultaneously.

A. 2 B. 3 C. 4 D. Many

7. The prompt issued by the shell is called ______

A. prompt B. command translator C. command prompt D. command executor

8. In UNIX there are ___ major types of shells.

A. 2 B. 3 C. 4 D. 5

9. What is the default symbol for command prompt in Bourne shell?

A. ! B. # C. $ D. @

10. Which shell is the most common and best to use?

A. Korn shell B. C. Bourne shell D. Shell

11. Which symbol is used for taking input from standard input?

A. & B. % C. - D. $

12. Which of the following symbol(s) can be used to redirect the output to a file or another program?

A. | B. > C. >> D. All of the above

13. The >> symbol is used to overwrite the existing file if it exists and | is used to give input to another program.

A. True, False B. True, True C. False, True D. False, False

14. We can redirect the error message to file named newfile using ______command.

A. cat foo errorfile B. cat foo >errorfile C. cat errorfile>foo D. cat foo 2>errorfile

15. Which symbol is used to redirect error messages to /dev/null?

A. < B. > C. % D. $

16. Which command saves one copy of character stream in a file and store the other to standard output?

A. who B. tee C. ls D. wc

17. Which of the following is not true about tee command?

A. it is a feature of the shell B. it is an external command C. tee command duplicates its input D. tee is an internal command

18. A ______is used to redirect input into an interactive or program.

A. document B. here C. here document D. who

19. What is the use of pgm < file command?

A. Output of pgm is redirected to file B. Program pgm reads its input from file C. Output of pgm is appended to file D. Takes output from one program, or process, and sends it to another

20. What is the use of n >& m command?

A. Merges output from stream n with stream m B. Merges input from stream n with stream m C. Both A and B D. None of the above

21. The name of a variable can contain ______.

A. numbers B. letters C. underscore character D. All of the above

22. Unix shell variables will have their names in _____.

A. Uppercase B. Lowercase C. First character Uppercase and all other character Lowercase D. First character Lowercase and all other character Uppercase

23. Whch of the following is invalid variable names?

A. VAR_1 B. _ALI C. VAR1 D. VAR_A!

24. Shell variables are of ____ types.

A. 3 B. 4 C. 2 D. 5

25. Which of the following command is used to display the environment variables only?

A. sh B. set C. env D. var

26. How many prompt shell has?

A. 4 B. 2 C. 3 D. 5

27. Which keyword is used to remove the variable?

A. remove B. readonly C. unset D. delete

28. We cannot use the unset command to unset variables that are marked ______.

A. read B. write C. readonly D. writeonly

29. Which one of the following is not an environment variable?

A. env B. Path C. Home D. User 30. $# is used to show?

A. The number of arguments supplied to a script. B. The filename of the current script. C. The exit status of the last command executed. D. The process number of the last background command

31. Which of the following operator is not supported in Bourne shell?

A. Arithmetic Operators B. Boolean Operators C. Character operators D. File Test Operators

32. Which external program used by bourne shell to perform simple arithmetic operations?

A. awk B. expr C. sum D. Both A and B

33. The complete expr and awk expression should be enclosed between ______.

A. () B. " " C. ' ' D. < >

34. In relational operator, which keyword is used to represent greater than or equal?

A. -eq B. -gte C. -ge D. -gt

35. Which of the boolean operator is supported in bourne shell?

A. and B. or C. not D. All of the above

36. What is the use of str operator in bourne shell?

A. Checks if str is not the empty string B. Checks if the given string operand size is non-zero C. Checks if the given string operand size is zero D. Checks if the value of two operands are equal or not

37. Which File test operator is used to checks if file has its sticky bit set?

A. -g B. -k C. -p D. -a 38. What is the used of -x file test operator?

A. Checks if file is executable B. Checks if file has size greater than 0 C. Checks if file exists D. Checks if file has its Set User ID (SUID) bit set

39. What is the use of -z string operator in bourne shell?

A. Checks if the value of two operands are equal or not B. Checks if the given string operand size is zero C. Checks if str is not the empty string D. Checks if the given string operand size is non-zero

40. What is the use of -e file test operator in korn shell?

A. Checks if file is a directory B. Checks if file is an ordinary file as opposed to a directory or special file C. Checks if file exists D. Checks if file is executable

41. DHCP (dynamic host configuration protocol) provides ______to the client. a) IP address b) MAC address c) Url d) None of the mentioned

42. DHCP is used for ______a) IPv6 b) IPv4 c) Both IPv6 and IPv4 d) None of the mentioned

43. The DHCP server ______a) maintains a database of available IP addresses b) maintains the information about client configuration parameters c) grants a IP address when receives a request from a client d) all of the mentioned

44. IP assigned for a client by DHCP server is a) for a limited period b) for an unlimited period c) not time dependent d) none of the mentioned

45. DHCP uses UDP port ______for sending data to the server. a) 66 b) 67 c) 68 d) 69

46. The DHCP server can provide the ______of the IP addresses. a) dynamic allocation b) automatic allocation c) static allocation d) all of the mentioned

47. DHCP client and servers on the same subnet communicate via ______a) UDP broadcast b) UDP unicast c) TCP broadcast d) TCP unicast

48. After obtaining the IP address, to prevent the IP conflict the client may use ______a) internet relay chat b) broader gateway protocol c) address resolution protocol d) none of the mentioned

49. What is DHCP snooping? a) techniques applied to ensure the security of an existing DHCP infrastructure b) encryption of the DHCP server requests c) algorithm for DHCP d) none of the mentioned

50. If DHCP snooping is configured on a LAN switch, then clients having specific ______can access the network. a) MAC address b) IP address c) Both MAC address and IP address d) None of the mentioned