Explore topic-wise MCQs in Technical Programming.

This section includes 746 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.

501.

The ‘mapfile’ command

A. reads lines of standard input and assigns each to the element of an indexed array
B. reads lines of standard output file
C. reads lines of standard error file
D. none of the mentioned
Answer» B. reads lines of standard output file
502.

The command ‘umask -S’

A. prints the current mask using symbolic notation
B. prints the current mask using octal numbers
C. sets the mask to 000
D. sets the mask to 777
Answer» B. prints the current mask using octal numbers
503.

The ‘logout’ built in command is used to

A. shutdown the computer
B. logoff of the computer
C. logout the current user
D. to exit the current shell
Answer» E.
504.

The command ‘hash’

A. manages a internal hash table
B. find and remember the full path name of the specified command
C. displays used command names and the number of hits
D. all of the mentioned
Answer» E.
505.

Which command concatenate the specified argument into a single command, then execute the command?

A. fc
B. eval
C. exec
D. getopts
Answer» C. exec
506.

Which command can create environment variable?

A. export
B. set
C. read
D. none of the mentioned
Answer» B. set
507.

The command ‘enable -n ‘

A. enables the specified built-in command
B. disables the specified built-in command
C. print the status of the command
D. none of the mentioned
Answer» C. print the status of the command
508.

The command ‘disown -r’

A. removes all jobs
B. removes all running jobs
C. marks jobs to not receive SIGHUP when bash exits
D. marks all jobs
Answer» C. marks jobs to not receive SIGHUP when bash exits
509.

Which command prints the directory stack?

A. cd
B. dirs
C. popd
D. pushd
Answer» C. popd
510.

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

A. continue
B. break
C. complete
D. command
Answer» B. break
511.

The command ‘compgen -c’ shows

A. all variable names
B. all system wide aliases
C. full list of all commands
D. none of the mentioned
Answer» D. none of the mentioned
512.

What is the function of bind command in bash shell?

A. defining new macros
B. defining new key bindings for existing commands
C. dumping the installed key bindings
D. all of the mentioned
Answer» E.
513.

Which command sets up shorthand for command or command line?

A. set
B. alias
C. new
D. echo
Answer» C. new
514.

Which command terminates a running process by name of the process?

A. kill
B. pkill
C. killall
D. none of the mentioned
Answer» D. none of the mentioned
515.

‘stty tostop’ command will

A. stop all jobs running in the shell
B. stop background jobs if they try to send output to the terminal
C. this is not a valid command
D. none of the mentioned
Answer» C. this is not a valid command
516.

‘kill %s’ command will

A. terminate the job whose command line starts with s
B. terminate the last job
C. terminate the first job
D. none of the mentioned
Answer» B. terminate the last job
517.

Which command brings a background job into the foreground?

A. fg
B. bg
C. jobs %1
D. none of the mentioned
Answer» B. bg
518.

Ctrl-Z key combination

A. generates a SIGINT signal
B. stops the process running in the shell
C. kills the process running in the shell
D. generates a SIGINT signal & kills the process running in the shell
Answer» C. kills the process running in the shell
519.

What is job number?

A. same as PID
B. a unique number, assigned to each job in shell
C. same as PID and a unique number, assigned to each job in shell
D. none of the mentioned
Answer» C. same as PID and a unique number, assigned to each job in shell
520.

Which command allows to view the current jobs being handled by the shell?

A. jobs
B. view
C. show
D. none of the mentioned
Answer» B. view
521.

Which one of the following is not correct about job control in bash shell?

A. it is the ability to stop and resume any process running in shell at a later point
B. user employs this facility via an interactive interface supplied by the kernel’s terminal driver and bash
C. it is the ability to create any process
D. none of the mentioned
Answer» D. none of the mentioned
522.

Which command is used to reexecute the previous command?

A. !!
B. !cat
C. !3
D. !$
Answer» B. !cat
523.

fc stands for

A. find command
B. fix command
C. both find & fix command
D. none of the mentioned
Answer» D. none of the mentioned
524.

Which one of the following is bitwise ‘exclusive or’ operator?

A. ^=
B. |=
C. !=
D. none of the mentioned
Answer» B. |=
525.

If a and b are 2 variables then the meaning of a<<=b is

A. b = a << b
B. a = a << b
C. b = b << a
D. a = a << b
Answer» C. b = b << a
526.

Which expression use the value of the enclosed arithmetic expression?

A. $(())
B. $()
C. ${}
D. $[].
Answer» B. $()
527.

Which built-in command performs integer arithmetic in bash shell?

A. let
B. get
C. set
D. none of the mentioned
Answer» B. get
528.

To redefine a variable, it can be removed from the list of variables by using the command

A. unset
B. delete
C. remove
D. clear
Answer» B. delete
529.

Which one of the following is not a valid shell variable?

A. _san
B. san_2
C. _san_2
D. 2_san
Answer» E.
530.

Which one of the following statement is true about variables in shell?

A. variables do not require declaration before assigning value to them
B. variables are case sensitive
C. to extract the contents of a variable, we have to provide the variable a preceding $
D. all of the mentioned
Answer» E.
531.

Which command reads user input from the terminal and assign this value to a variable name?

A. read
B. get
C. declare
D. set
Answer» B. get
532.

In the shell, by default, all variables are considered and stored as

A. string
B. integer
C. character
D. float
Answer» B. integer
533.

Functions improves the shell’s programmability significantly, because

A. when we invoke a function, it is already in the shell’s memory, therefore a function runs faster than seperate scripts
B. function will not provides a piece of code for repetative tasks
C. all of the mentioned
D. none of the mentioned
Answer» B. function will not provides a piece of code for repetative tasks
534.

The keyword ‘local’ is used

A. to define a variable within a function for its local scope
B. to redefine any global variable
C. this is not a valid keyword
D. none of the mentioned
Answer» B. to redefine any global variable
535.

Which of the following command provides the list of the functions defined in the login session?

A. declare -f
B. declare -F
C. both declare -f and -F
D. none of the mentioned
Answer» D. none of the mentioned
536.

Parameters can be passed to a function

A. by using the parameter variables $1, $2, $3…….
B. by using the environment variables
C. by using the parameter & environment variables
D. none of the mentioned
Answer» B. by using the environment variables
537.

When the return value of any function is not specified within the function, what function returns?

A. nothing
B. exit status of the last command executed
C. 0
D. none of the mentioned
Answer» C. 0
538.

What is the command that can print lines of first file matching with second file?

A. printline
B. cmp
C. com
D. comm
Answer» E.
539.

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

A. user1
B. user1 tty 0 1234
C. tty
D. tty 0 1234
Answer» B. user1 tty 0 1234
540.

How do you remove duplicate lines from the file foo using uniq?

A. sort foo | uniq –u
B. sort -u foo | uniq -d
C. sort foo | uniq –c
D. sort foo | uniq –I
Answer» B. sort -u foo | uniq -d
541.

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

A. grep ‘^[a-zA-Z0-9]’
B. grep ‘[^a-zA-Z0-9]’
C. grep ‘[a-zA-Z0-9]’
D. None of the mentioned
Answer» C. grep ‘[a-zA-Z0-9]’
542.

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

A. grep –i Bob files
B. grep ‘B[oO][bB]’ files
C. grep ‘[BOB]’ files
D. grep -v ‘Bob’ files
Answer» C. grep ‘[BOB]’ files
543.

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

A. uniq -u
B. uniq -d
C. uniq -c
D. uniq -I
Answer» B. uniq -d
544.

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

A. The count of lines that do not contain the pattern echo in file abc
B. The count of lines which begin with the pattern echo in file abc
C. The count of lines that ends with the pattern echo in file abc
D. None of the mentioned
Answer» C. The count of lines that ends with the pattern echo in file abc
545.

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

A. fileA, fileB and fileABC
B. fileABC
C. fileA and fileB
D. fileAB, fileBC and fileABC
Answer» D. fileAB, fileBC and fileABC
546.

How can you search for blank line in a file?

A. $ grep “ “ file
B. $ grep “^$” file
C. $ grep [“ “] file
D. $ grep [^$] file
Answer» C. $ grep [“ “] file
547.

Which option of grep displays the line number as well?

A. -v
B. -l
C. -n
D. -E
Answer» D. -E
548.

Which variable will display the list of the positional parameters?

A. $#
B. $*
C. $?
D. $$
Answer» C. $?
549.

What is the output of the following command for bash shell: echo linux $0

A. linux echo
B. linux linux
C. linux bash
D. linux
Answer» D. linux
550.

What command would send the output of cmd1 to the input of cmd2?

A. cmd1 | cmd2
B. cmd1 || cmd2
C. cmd1 && cmd2
D. cmd1 ; cmd2
Answer» B. cmd1 || cmd2