Quiznetik

Linux Programming | Set 2

1. Which command will you use to see the available routes?

Correct : C. netstat -r

2. The permission -rwxr-xr-t represented in octal expression will be

Correct : B. 1755

3. With a umask value of 112, what is the default permission assigned to newly created regular file?

Correct : D. -rw-rw-r–

4. Which command is used to assign read-write permission to the owner?

Correct : C. chmod u=rw file

5. Given the command $ chmod o-w datafile

Correct : D. clears write permission to others for datafile

6. Which of these commands will set the permissions on file textfile to read and write for the owner, read for the group, and nothing for everyone else?

Correct : B. chmod 640 textfile

7. If you are a root user, how can you grand execute permission only for the owner of the file project1?

Correct : B. chmod u+x project1

8. A user executes the following command successfully: $ chmod +x file1.txt Which of the following is true of the output of this command?

Correct : D. The command results in adding execute permission for all users (i.e., user,group & others)

9. What does chmod +t do?

Correct : D. set the sticky bit

10. Which of the following umask settings doesn’t allow execute permission to be set by default on directory files

Correct : D. 444

11. Which of the following umask settings allow execute permission to be set by default on regular files

Correct : D. None of the given choices

12. The command chmod 4777 a.out

Correct : A. will set the suid bit of a.out

13. The commonly used UNIX commands like date, Is, cat, etc. are stored in

Correct : B. /bin and /usr/bin directories

14. Which command is used to concatenate all files beginning with the string ‘emp’ and followed by non-numeric characters?

Correct : A. catemp{!0-9]

15. Which command will be used to match the pattern agarwal, Aggarwal, Agggarwal and agrawal in the file named empl.1st?

Correct : A. grep “[aA]99*[ar][ra]wal” empl.1st

16. Which command is used to select those lines where the data lies between 7000 and 7999 at the end of the line of file empl.lit.

Correct : C. grep “7…$” empl.1st

17. Which command is used to select those lines that begin with a 2 in the tre file empl.1st?

Correct : A. grep “^2” empl.1st

18. Which of the following commands is used to update access and modification times of a file?

Correct : C. touch

19. The command that can be used to restrict incoming messages to a user is

Correct : A. mesg

20. The command which transcribes the standard input to the standard output and also makes a copy of the same in a file is

Correct : C. tr

21. What command is used to count the total number of lines, words, and characters contained in a file?

Correct : C. wc

22. What command is used to remove files?

Correct : B. rm

23. What command is used with vi editor to delete a single character?

Correct : A. x

24. What command is used to save the standard output in a file, as well as display it on the terminal?

Correct : A. tee

25. What command is used to count just the number of lines contained in a file?

Correct : D. wc –l

26. What command is used to sort the lines of data in a file in reverse order?

Correct : A. sort –r

27. What shell's wild-card is used to match a single character?

Correct : C. ?

28. Which of the following command lists the last 10 lines of a file?

Correct : B. tail

29. Which statement resumes the next iteration of a for, while, select, or untill loop?

Correct : B. break

30. Which command can create environment variable?

Correct : D. none of the mentioned

31. Which of the following is not a major Unix shell?

Correct : C. Bash Shell

32. Which was the first Unix shell?

Correct : B. C Shell

33. The purpose of the PATH variable is to

Correct : C. Tells the shell what directories to search when a command is entered

34. What special character is used to designate the users home directory in the C shell?

Correct : C. &

35. The shell in the Unix system is the

Correct : A. Outer layer of a seed

36. The asterisk is a meta-character which in the command "ls *.txt" means

Correct : A. Any single character

37. Which command runs the shell built-in command ‘command’ with the given argument?

Correct : A. builtin

38. Which option of the command ‘cd’ use the actual filesystem path for cd..and the value of pwd?

Correct : D. -P

39. Which command generates possible completions for string according to the and write it to standard output?

Correct : A. compgen

40. Which command executes ‘command’ in place of the current process instead of creating a new process?

Correct : A. exec

41. Which of the following is not a iterative construct in "bash"?

Correct : C. Until

42. Assuming the files fileA, fileB, fileAB, fileBC and fileABC, exist in a directory, which files match with the pattern file[ABC]?

Correct : C. fileA and fileB

43. What will be printed for the command below? $ grep –c “^echo” abc

Correct : B. The count of lines which begin with the pattern echo in file abc

44. Which one is used to select only one copy of the repeated lines?

Correct : A. uniq -u

45. Indicate the right option to search for BOB, Bob, BOb or BoB?

Correct : B. grep ‘B[oO][bB]’ files

46. Indicate the right option to search for anything not a letter or number

Correct : B. grep ‘[^a-zA-Z0-9]’

47. One of the entry of /etc/passwd file is shown below: user1:x:1111:2222:McqMate:/home/user1:/bin/bash Which among the following will print userid and home dir in the following pattern “user1:/home/user1”

Correct : A. awk `{print $1 “:” $6}` /etc/passwd

48. who cut –d ” ” -f1 what is the ouput if the who command displays like this user1 tty 0 1234

Correct : A. user1

49. FIFO Stands For :

Correct : B. First in First Out

50. The set of possible names for a given type of IPC is called its

Correct : B. Name Space

51. Signals can be sent

Correct : D. By (a),(b) and (c)

52. Similar to read and write system calls

Correct : C. (a) and (b) both

53. NetBIOS is

Correct : A. Session Service

54. UDP stands for

Correct : A. User datagram Protocol

55. TCP stands for

Correct : A. Transmission Control protocol

56. How to identify a communication?

Correct : D. All the above

57. The physical layer of a network

Correct : C. defines the electrical characteristics of signals passed between the computer and communication devices

58. What TCP/IP protocol is used for remote terminal connection service?

Correct : D. TELENET

59. How many networks and nodes per network, are allowed by the Class B network?

Correct : B. 16,384 networks and 65,534 nodes per network

60. What service is used to translate domain names to IP addresses?

Correct : D. DNS

61. What TCP/IP protocol is used for file transfer with minimal capability and minimal overhead?

Correct : B. TFTP

62. What TCP/IP protocol is used for transferring electronic mail messages from one machine to another?

Correct : C. SMTP

63. What can he used to set up a firewall on a Linux system?

Correct : D. ipchains

64. What service is not monitored by inetd ?

Correct : A. SSH

65. What command do you use to add routes to a Linux router?

Correct : B. route

66. Which of the following is not a communication command?

Correct : A. grep

67. What protocol(s) is (are) allowed a user to retrieve her/his mail from the mail server to her/his mail reader?

Correct : A. POP3

68. The 32-bit internet address 10000000 00001010 00000010 00011110 will be written in dotted decimal notation as

Correct : A. 128.10.2.30

69. Which class network is used for a collection of a small number of networks with a large number of nodes?

Correct : A. Class A

70. What type of addressing format is used by Class A network?

Correct : D. Net.Node.Node.Node

71. How many class A, B and C network IDs can exist?

Correct : D. 2,113,658

72. Communication using UDP is usually____________.

Correct : A. connectionless,iterative

73. Communication using TCP is usually____________.

Correct : D. connection-oriented,concurrent

74. SOCK_STREAM sockets are used by ______ processes.

Correct : B. TCP

75. SOCK_DGRAM sockets are used by ______ processes.

Correct : A. UDP

76. An interface is a set of ___________ designed to facilitate interaction between two entities

Correct : B. instructions

77. How many types of sockets are there?

Correct : C. 4

78. If a signal is received by a process, when will it be processed?

Correct : B. It is processed when process is switching to kernel mode

79. Which signal is generated when we press control-C?

Correct : A. SIGINT

80. Which signal is generated when we press ctrl-Z?

Correct : D. SIGINT

81. Which signal is sent when the Child process terminates?

Correct : B. SIGKILL

82. Which of the following signal cannot be handled or ignored?

Correct : C. SIGKILL

83. Another signal that cannot be caught is:

Correct : C. SIGSTOP

84. When real interval timer expires which signal is generated?

Correct : D. SIGALRM

85. Signals are handled using which system call?

Correct : B. signal

86. Default action of SIGSEGV is

Correct : B. Core dump

87. The kill system call is used to

Correct : B. Send a signal to a process

88. Which is true regarding pipes?

Correct : A. half duplex

89. The persistancy of a FIFO is

Correct : C. file system

90. Advantage of FIFO over pipe is

Correct : B. unrelated processes can communicate

91. What mkfifo() creats?

Correct : C. named pipe

92. System V IPC common attributes are

Correct : D. all the above

93. Which one of the following is not system V IPC ?

Correct : C. FIFO

94. Which system call is used to create Sys V message Queue ?

Correct : A. msgget

95. Which is not the correct option for removing a message queue ?

Correct : C. ipcrm -m

96. Message queues are created in

Correct : B. kernelspace