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.

551.

Which of the following file set in the current directory are identified by the regular expression a?b*

A. afcc, aabb
B. aabb, axbc
C. abbb, abxy
D. abcd, axbb
Answer» C. abbb, abxy
552.

Specifies

A. one or more character
B. zero or more charecter
C. one character
D. none of the mentioned
Answer» D. none of the mentioned
553.

* Specifies

A. one or more character
B. zero or more charecter
C. nothing
D. none of the mentioned
Answer» C. nothing
554.

Which command can be used to test various file attributes

A. if
B. file
C. test
D. type
Answer» D. type
555.

Which variable contains last background job process id

A. $*
B. $?
C. $$
D. $!
Answer» E.
556.

Which variable is used to display number of arguments specified in command line

A. $0
B. $#
C. $*
D. $?
Answer» C. $*
557.

The $ variables in a shell script context designates

A. The runtime of the script
B. Number of command line arguments
C. PID of the shell running the script
D. The exit status of the shell script
Answer» D. The exit status of the shell script
558.

Executing cat /etc/password > /dev/sda as superuser will

A. Write data into a regular file called /dev/sda
B. Write data to the physical device sda
C. Create a temporary file /dev/sda and write data to it
D. None of the mentioned
Answer» C. Create a temporary file /dev/sda and write data to it
559.

cat < file1 >> file2 | file3

A. file1 content will be appended to file2 and finally stored in file3
B. file1 content will be appended to file2 and file3 will be ignored
C. file2 and file3 will have same content
D. syntax error
Answer» E.
560.

Syntax to suppress the display of command error to monitor?

A. command > &2
B. command 2> &1
C. command 2> &2
D. command 2> /dev/null
Answer» E.
561.

Which of these is the correct method for appending “foo” in /tmp/bar file?

A. echo foo > /tmp/bar
B. echo foo >> /tmp/bar
C. echo foo | /tmp/var
D. /tmp/bar < echo foo
Answer» C. echo foo | /tmp/var
562.

cmd > abc 2>&1 will

A. Write file2 to file1
B. Write standard output and standard error to abc
C. Write standard error to abc
D. Write standard output to abc & standard error to monitor
Answer» C. Write standard error to abc
563.

cmd 2>&1 > abc will

A. Write file2 to file1
B. Write standard output and standard error to abc
C. Write standard error to abc
D. Write standard output to abc & standard error to monitor
Answer» E.
564.

The redirection 2> abc implies

A. Write file 2 to file abc
B. Write standard output to abc
C. Write standard error to abc
D. None of the mentioned
Answer» D. None of the mentioned
565.

Which of the following files will not be displayed by the command cat re* ?

A. reminder
B. receipt
C. Receipt
D. recipe-cake
Answer» D. recipe-cake
566.

BASH shell stands for?

A. Bourne-again Shell
B. Basic Access Shell
C. Basic to Advanced Shell
D. Big & Advanced Shell
Answer» B. Basic Access Shell
567.

The user bhojas logged in and performed the following sequence of command. What will be the output of the last command? $ cd project/module1 $ pwd

A. /home/bhojas/project/module1
B. /home/project/module1
C. /usr/bhojas/project/module1
D. project/module1
Answer» B. /home/project/module1
568.

Which of the following represents an absolute path?

A. ../home/file.txt
B. bin/cat
C. cs2204/
D. /usr/bin/cat
Answer» E.
569.

What is a shell in UNIX?

A. a program through which users can issue commands to UNIX
B. a window management system
C. the login screen
D. the thing that rides on the back of a turtle in UNIX
Answer» B. a window management system
570.

Which is true with regards to the shell prompt

A. It can be accidentally erased with backspace
B. The prompt cannot be modified
C. The prompt can be customized (modified)
D. None of the mentioned
Answer» D. None of the mentioned
571.

If a file with execute permissions set, but with unknown file format is executed

A. The file is passed to /bin/sh
B. The system returns an error
C. The current shell will try to execute it
D. None of the mentioned
Answer» D. None of the mentioned
572.

Shell is ?

A. Command Interpreter
B. Interface between Kernel and Hardware
C. Interface between user and applications
D. Command Compiler
Answer» B. Interface between Kernel and Hardware
573.

Hidden files are

A. Those whose ‘read’ bit is set to ‘h’
B. Permitted for (can be accessed) only superusers
C. Files that begin with a ‘.’
D. Files that cannot be opened by ordinary user for writing
Answer» D. Files that cannot be opened by ordinary user for writing
574.

For every successful login, which script will be executed?

A. /etc/inittab
B. /etc/profile
C. /etc/login
D. /etc/init
Answer» C. /etc/login
575.

Which command is used to debug a shell script program

A. set
B. set -x
C. debug
D. db
Answer» C. debug
576.

Which variable contains current shell process id

A. $*
B. $?
C. $$
D. $!
Answer» D. $!
577.

While executing a command, the shell

A. Executes it in the same process (as shell)
B. Creates a child shell to execute it
C. Loads a special program to take care of the execution
D. None of the mentioned
Answer» C. Loads a special program to take care of the execution
578.

Which of the following commands allows definition and assignment of environment variables under bash

A. env
B. export
C. environ
D. setenviron
Answer» B. export
579.

To feed standard output of one command to standard input of another in a single shell session

A. IO redirection can be used
B. Named pipes can be used
C. The pipe operator provided by the shell can be used
D. It can not be done
Answer» D. It can not be done
580.

The statement z = ‘expr 5 / 2’ would store which of the following values in z?

A. 0
B. 1
C. 2
D. 2.5
Answer» D. 2.5
581.

The expression expr -9 % 2 evaluates to:

A. 0
B. 1
C. -1
D. 2
Answer» D. 2
582.

which of these is NOT a valid variable in bash

A. __ (double underscore)
B. _1var (underscore 1 var )
C. _var_ (underscore var underscore)
D. some-var (some hyphen var)
Answer» E.
583.

Create a new file “new.txt” that is a concatenation of “file1.txt” and “file2.txt”

A. cp file.txt file2.txt new.txt
B. cat file1.txt file2.txt > new.txt
C. mv file[12].txt new.txt
D. ls file1.txt file2.txt | new.txt
Answer» C. mv file[12].txt new.txt
584.

How do you print the lines between 5 and 10, both inclusive

A. cat filename | head | tail -6
B. cat filename | head | tail -5
C. cat filename | tail +5 | head
D. cat filename | tail -5 | head -10
Answer» B. cat filename | head | tail -5
585.

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
Answer» D. /etc/profile
586.

By default, a Linux user falls under which group?

A. staff
B. others
C. same as userid (UPG)
D. system
Answer» D. system
587.

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
Answer» B. List the users
588.

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
Answer» C. passd
589.

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
Answer» B. The shell program that authenticates the user while logging in
590.

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
Answer» C. The id of a user when the user’s account is deleted
591.

The /etc/passwd file doesn’t contain

A. userid
B. home directory for a user
C. login shell name
D. none of the mentioned
Answer» E.
592.

Which of the following identifiers associated with a process decide its privilege level

A. uid
B. suid
C. euid
D. gid
Answer» D. gid
593.

A user can change the default log-in shell using

A. chmod
B. chsh
C. rmsh
D. tchsh
Answer» C. rmsh
594.

The encrypted password of a user is stored in

A. /etc/shadow
B. /etc/enpasswwd
C. /etc/.passwd
D. /etc/passwd
Answer» B. /etc/enpasswwd
595.

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
Answer» B. /etc/groups
596.

nohup is used to

A. automatically hang up the process after logout
B. continue the process after logout
C. create backgroung process
D. manually hang up the process after logout
Answer» C. create backgroung process
597.

we can change the priority of a running process using

A. nice
B. renice
C. priority cannot be changed for a running process
D. only superuser can change the priority
Answer» C. priority cannot be changed for a running process
598.

The signal sent to a process when the Ctrl-C key is pressed is

A. KILL
B. TSTP
C. TERM
D. INT
Answer» E.
599.

When a child process exits before the parent process exits, which of the following is tru

A. the child process becomes defunct
B. the parent process becomes defunct
C. if the parent process does not handle SIGCHLD, the child process becomes a zombie
D. none of the mentioned
Answer» D. none of the mentioned
600.

Which of the following values for STAT column of ps command is not true:

A. status R means running
B. Status S means sleeping
C. Status E means exited
D. Status Z means zombie
Answer» D. Status Z means zombie