linux banner

Linux Multiple Choice Questions (MCQs) and Answers

Master Linux with Practice MCQs. Explore our curated collection of Multiple Choice Questions. Ideal for placement and interview preparation, our questions range from basic to advanced, ensuring comprehensive coverage of Linux concepts. Begin your placement preparation journey now!

Q91

Q91 A user is unable to update their package list using yum.
What could be the problem?

A

The user does not have sudo privileges

B

The repository list is incorrect

C

The package manager is not installed

D

The system is not connected to the internet

Q92

Q92 Which command is used to display system resource usage in real-time?

A

ps

B

top

C

df

D

du

Q93

Q93 What does the vmstat command do in Linux?

A

Displays virtual memory statistics

B

Displays disk usage

C

Displays network statistics

D

Displays process status

Q94

Q94 Which command is used to display a detailed report of CPU usage?

A

mpstat

B

iostat

C

sar

D

uptime

Q95

Q95 What is the purpose of the iostat command?

A

To report CPU utilization and I/O statistics

B

To display network statistics

C

To show system uptime

D

To monitor memory usage

Q96

Q96 How do you display the memory usage in a human-readable format using the free command?

A

free -h

B

free -m

C

free -g

D

free -b

Q97

Q97 How do you check the disk usage of a directory named /home/user using the du command?

A

du -sh /home/user

B

du -h /home/user

C

du -c /home/user

D

du -a /home/user

Q98

Q98 How do you display the last 100 lines of a system log file named /var/log/syslog using the tail command?

A

tail -100 /var/log/syslog

B

tail -n 100 /var/log/syslog

C

tail --lines=100 /var/log/syslog

D

tail /var/log/syslog

Q99

Q99 A user reports high CPU usage on their system.
Which command can help identify the process causing this issue?

A

top

B

free

C

df

D

ps

Q100

Q100 A system is experiencing high load average values.
What could be a likely cause?

A

Insufficient RAM

B

High I/O wait time

C

Low disk space

D

Network congestion

Q101

Q101 A user reports that their system is running out of memory.
Which command can help identify memory usage by processes?

A

top

B

free

C

ps aux --sort=-%mem

D

vmstat

Q102

Q102 Which command is used to display the IP address of a Linux system?

A

ifconfig

B

ping

C

traceroute

D

netstat

Q103

Q103 What is the purpose of the ping command in Linux?

A

To check disk usage

B

To check network connectivity

C

To list open ports

D

To configure network interfaces

Q104

Q104 Which command is used to display the routing table in Linux?

A

route

B

netstat

C

ping

D

ifconfig

Q105

Q105 What is the function of the traceroute command?

A

To display the path packets take to reach a network host

B

To monitor network traffic

C

To display active network connections

D

To check disk usage

Q106

Q106 How do you display all active network connections using the netstat command?

A

netstat -a

B

netstat -r

C

netstat -i

D

netstat -s

Q107

Q107 How do you find the IP address of the hostname "example.com" using the nslookup command?

A

nslookup example.com

B

nslookup -type=A example.com

C

nslookup -type=MX example.com

D

nslookup -type=NS example.com

Q108

Q108 How do you display network interface statistics using the ifconfig command?

A

ifconfig -s

B

ifconfig -a

C

ifconfig -v

D

ifconfig -r

Q109

Q109 A user reports that they cannot reach a website.
Which command can help determine if the network connection is working?

A

ifconfig

B

ping

C

route

D

netstat

Q110

Q110 A user cannot resolve the hostname "example.com".
Which command can help diagnose this issue?

A

ping

B

traceroute

C

nslookup

D

netstat

Q111

Q111 Which command is used to add a new user in Linux?

A

useradd

B

usermod

C

userdel

D

groupadd

Q112

Q112 What is the purpose of the passwd command?

A

To create a new user

B

To delete a user

C

To change a user's password

D

To modify user information

Q113

Q113 Which file contains user account information in Linux?

A

/etc/passwd

B

/etc/shadow

C

/etc/group

D

/etc/userinfo

Q114

Q114 What does the usermod -aG command do?

A

Adds a user to a group

B

Modifies user account information

C

Deletes a user

D

Locks a user account

Q115

Q115 How do you delete a user named "john" and remove their home directory?

A

userdel john

B

userdel -r john

C

userdel -d john

D

userdel -f john

Q116

Q116 How do you change the primary group of a user named "alice" to "developers"?

A

usermod -g developers alice

B

usermod -G developers alice

C

groupmod -g developers alice

D

usermod -aG developers alice

Q117

Q117 A user reports that they cannot change their password.
Which command can help resolve this issue?

A

useradd

B

passwd

C

usermod

D

groupadd

Q118

Q118 A user is unable to login to their account.
Which file should be checked for locked accounts?

A

/etc/passwd

B

/etc/shadow

C

/etc/group

D

/etc/login.defs

Q119

Q119 Which command is used to display disk usage in a human-readable format?

A

du -h

B

df -h

C

lsblk

D

fdisk -l

Q120

Q120 What is the purpose of the fsck command?

A

To check and repair file systems

B

To format a disk

C

To create partitions

D

To display disk usage

ad verticalad vertical
ad