Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

Linux MCQ Set 1

1. Which one of the following is not true about GDB?
a) quit command is used to exit the GDB
b) kill command is used to stop execution in GDB
c) if the execution is stopped by kill command then it can not be started again
d) none of the mentioned

View Answer

Answer: c [Reason:] None.

2. While debugging with GDB
a) variables can be print
b) variables can be modify
c) variables can be print & modify
d) none of the mentioned

View Answer

Answer: c [Reason:] None.

3. GDB command “frame” is used
a) to change the stack frames
b) to check the stack frames only
c) it is not a valid command
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

4. The GDB command “info local”
a) displays the list of local variables
b) value of local values for the current stack frame
c) displays the list of local variables & value of local values for the current stack frame
d) none of the mentioned

View Answer

Answer: c [Reason:] None.

5. If we have multiple source files, then during the debugging with GDB
a) breakpoint can not be set
b) break point can be set by “break” command with a filename
c) break point can be set only to makefile
d) none of the mentioned

View Answer

Answer: b [Reason:] None.

6. What is temporary breakpoint?
a) it stops the program once
b) it is removed after one execution of the program
c) it stops the program once & removes after one execution of the program
d) none of the mentioned

View Answer

Answer: c [Reason:] None.

7. In GDB breakpoints can be skipped by the command
a) ignore
b) reject
c) skip
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

8. Which GDB command is used to examine the memory?
a) x
b) y
c) z
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

9. Which one of the following is not true about the GDB?
a) info register is used to see that what is in the processor registers
b) processor registers can not be accessed by GDB
c) first 32 bits of the variable can not be examined
d) none of the mentioned

View Answer

Answer: c [Reason:] None.

10. Assemble code of the program can be displayed in GDB by the command
a) disassemble
b) assemble
c) assembly
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

Linux MCQ Set 2

1. The execution of the program in GDB can be affected by
a) arguments
b) working directory
c) environment
d) all of the mentioned

View Answer

Answer: d [Reason:] None.

2. While debugging with GDB, arguments to the program can be specified by the arguments of _____ command.
a) run
b) gdb
c) make
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

3. Inside GDB, a program may stop because of
a) a signal
b) a breakpoint
c) step command
d) all of the mentioned

View Answer

Answer: d [Reason:] None.

4. Which one of the following is a special breakpoint that stops the program when the value of an expression changes in GDB?
a) watchpoint
b) catchpoint
c) getpoint
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

5. With the list command, by default GDB prints the ____ source lines.
a) 20
b) 10
c) all
d) none of the mentioned

View Answer

Answer: b [Reason:] None.

6. In GDB which one of the following allows us to specify a variable in terms of the file or function where it is defined?
a) ::
b) @
b) $
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

7. If we want to print the value of a variable in hexadecimal, we have to use “print” command with the option ___ in GDB.
a) x
b) h
c) hex
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

8. Which one of the following variables is used within GDB to hold on to a value and refer to it later?
a) convenience variables
b) environment variables
c) temporary variables
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

9. In GDB, we can refer to machine register contents, in expressions, as variables with names starting with
a) $
b) #
c) !
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

10. In GDB hardware-dependent information about the floating point unit can be displayed by the command
a) info float
b) display float
c) show float
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

Linux MCQ Set 3

1. In GDB, a tracepoint can be set by the command
a) trace
b) set
c) break trace
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

2. Which one of the following command saves the command history of GDB in a file?
a) history
b) set history
c) set history save on
d) none of the mentioned

View Answer

Answer: c [Reason:] None.

3. The command “show commands” of GDB
a) displays the last 10 commands in the command history
b) displays all commands of the command history
c) displays all the commands available in GDB
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

4. The GDB command “show output-radix”
a) sets the default base for numeric display
b) displays the current default base for numeric display
c) sets the default base
d) none of the mentioned

View Answer

Answer: b [Reason:] None.

5. The user can define a command for GDB with the command
a) define
b) command
c) assign
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

6. By default the GDB automatically executes the command from its
a) init files
b) start files
c) begin files
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

7. The GDB text user interface uses the ____ library to show the source file.
a) Curses
b) YUI
c) JUI
d) None of the mentioned

View Answer

Answer: a [Reason:] None.

8. Which one of the following GDB command allows to move from one stack frame to another without printing the frame?
a) select-frame
b) frame
c) frame move
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

9. Which one of the following GDB command deletes any breakpoint at the next instruction to be executed in the selected stack frame?
a) clear
b) delete
c) disable
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

10. The result of an expression can be assigned to an environement variable with the command
a) assign
b) set
c) env
d) none of the mentioned

View Answer

Answer: b [Reason:] None.

Linux MCQ Set 4

1. User’s Primary Group id is listed in which file, at the time of creation of the user (On a standard Unix system)
a) /etc/passwd
b) /etc/groups
c) /etc/login
d) /etc/profile

View Answer

Answer: a [Reason:] None.

2. The encrypted password of a user is stored in
a) /etc/shadow
b) /etc/enpasswwd
c) /etc/.passwd
d) /etc/passwd

View Answer

Answer: a [Reason:] None.

3. A user can change the default log-in shell using
a) chmod
b) chsh
c) rmsh
d) tchsh

View Answer

Answer: b [Reason:] None.

4. Which of the following identifiers associated with a process decide its privilege level
a) uid
b) suid
c) euid
d) gid

View Answer

Answer: c [Reason:] None.

5. The /etc/passwd file doesn’t contain
a) userid
b) home directory for a user
c) login shell name
d) none of the mentioned

View Answer

Answer: d [Reason:] None.

6. User id 0 is
a) An innvalid user id
b) The id of the root user
c) The id of a user when the user’s account is deleted
d) None of the mentioned

View Answer

Answer: b [Reason:] None.

7. The login shell is
a) The shell program that runs when the user logs in
b) The shell program that authenticates the user while logging in
c) Common shell for all the users that belong to the same group
d) None of the mentioned

View Answer

Answer: a [Reason:] None.

8. Which of the following command can be used to change the user password?
a) user can’t change the password
b) passwd
c) passd
d) pwd

View Answer

Answer: b [Reason:] None.

9. What does the following command do ?
who | wc –l
a) List the number of users logged in
b) List the users
c) List the number of users in the system
d) Display the content of who command

View Answer

Answer: a [Reason:] None.

10. By default, a Linux user falls under which group?
a) staff
b) others
c) same as userid (UPG)
d) system

View Answer

Answer: c [Reason:] None.

11. Which of the following files need to be referred for user’s secondary group?
a) /etc/passwd
b) /etc/shadow
c) /etc/group
d) /etc/profile

View Answer

Answer: c [Reason:] None.

12. The ls –l output for /etc/passwd and /usr/bin/passwd is as follows:

-rw-rw-r-- 1 root root 2807 Apr 26 13:50 /etc/passwd
-r-s—x—x 1 root root 17008 May 25 02:30 /usr/bin/passwd
 
If a user, not belonging to the group ‘root’, runs the passwd executable in an attempt to modify his password, then which of the following is true?

a) password change fails since user does not have permission to update /etc/passwd file
b) password change is successful because the program runs as root
c) passwd change program runs in kernel mode where write access to the /etc/passwd file is possible
d) /etc/passwd is a special file and the system by default allows all users to update it

View Answer

Answer: b [Reason:] None.

Linux MCQ Set 5

1. Which command is used to display the octal value of the text
a) octal
b) text_oct
c) oct
d) od

View Answer

Answer: d [Reason:] None.

2. Which command is used to view compressed text file contents
a) cat
b) type
c) zcat
d) print

View Answer

Answer: c [Reason:] None.

3. Which command changes a file’s group owner
a) cgrp
b) chgrp
c) change
d) group

View Answer

Answer: b [Reason:] None.

4. Which command is used to extract intermediate result in a pipeline
a) tee
b) extract
c) exec
d) none of the mentioned

View Answer

Answer: a [Reason:] None.

5. Which command is used to extract a column from a text file
a) paste
b) get
c) cut
d) tar

View Answer

Answer: c [Reason:] None.

6. Which command is used to display disk consumption of a specific directory
a) du
b) ds
c) dd
d) dds

View Answer

Answer: a [Reason:] None.

7. Which command is used to perform backup in unix?
a) backup
b) cpio
c) zip
d) gzip

View Answer

Answer: b [Reason:] None.

8. Which command creates an empty file if file does not exist?
a) cat
b) touch
c) ed
d) read

View Answer

Answer: b [Reason:] None.

9. Which option of rm command is used to remove a directory with all its subdirectories
a) –b
b) –o
c) –p
d) –r

View Answer

Answer: d [Reason:] None.

10. Which command is used to identify file type?
a) Type
b) File
c) Finfo
d) Info

View Answer

Answer: b [Reason:] None.