Linux mcq for interview preparation 2025

 Which file contains user passwords in a hashed format?


a) /etc/passwd

b) /etc/shadow

c) /etc/security

d) /etc/secure


-------------------------------------------------------------------


What is the command to change the owner of a file?


a) chown

b) chmod

c) chgrp

d) chattr

---------------------------------------------------

Which command is used to set user quotas?


a) setquota

b) quotaon

c) edquota

d) repquota


Package Management

--------------------------------------------


Which command is used to install a package in Debian-based systems?


a) rpm

b) apt-get install

c) yum install

d) zypper install

--------------------------------------------------

Which command is used to remove a package in Red Hat-based systems?


a) apt-get remove

b) yum remove

c) rpm -e

d) zypper remove

------------------------------------------------------------------

What is the command to update the package list in Ubuntu?


a) apt-get upgrade

b) apt-get update

c) apt-get install

d) apt-get list

----------------------------------------------------


Which command is used to list installed packages in a Debian-based system?


a) dpkg --list

b) rpm -qa

c) yum list installed

d) zypper list installed


---------------------------------------------------------

What is the command to install a package using rpm?


a) rpm -ivh package.rpm

b) rpm -e package.rpm

c) rpm -Uvh package.rpm

d) rpm -q package.rpm



User and Group Management


-----------------------------------------------------------

Which command is used to add a new user?


a) adduser

b) useradd

c) newuser

d) createuser



---------------------------------------

Which command is used to delete a user?


a) userdel

b) deluser

c) removeuser

d) rmuser


------------------------------------------------------------

Which command is used to modify a user account?


a) usermod

b) modifyuser

c) chuser

d) changeuser

--------------------------------------------------------------------------


Which file contains user account information?


a) /etc/passwd

b) /etc/shadow

c) /etc/group

d) /etc/users


-----------------------------------------------------------------

Which command is used to create a new group?


a) groupadd

b) addgroup

c) newgroup

d) creategroup

Filesystem Hierarchy and Management


-----------------------------------------------------------------------------------

Which directory contains configuration files?


a) /etc

b) /var

c) /usr

d) /home


------------------------------------------------------------------------------------

Which directory contains user home directories?


a) /usr

b) /var

c) /home

d) /root


-------------------------------------------------------

Which command is used to mount a filesystem?


a) mount

b) umount

c) fsck

d) mkfs


--------------------------------------------------------------------------------------------------

Which command is used to check and repair a filesystem?


a) fsck

b) checkfs

c) repairfs

d) chkdsk


----------------------------------------------------------------------------------------

Which file contains the list of filesystems to be mounted at boot time?


a) /etc/fstab

b) /etc/mtab

c) /etc/filesystems

d) /etc/mount


-------------------------------------------------------

Which command is used to create a new filesystem?


a) mkfs

b) newfs

c) createfs

d) format


--------------------------------------------------------------------------------

Which directory contains log files?


a) /log

b) /var/log

c) /usr/log

d) /home/log


-------------------------------------------------


Which command is used to view the disk usage of a directory?


a) du

b) df

c) ls -lh

d) size



---------------------------------------------------------------

What does the ln command do?


a) Lists files in a directory

b) Links files

c) Lists network interfaces

d) Lists processes



Which directory is the root of the filesystem hierarchy?


a) /

b) /root

c) /home

d) /usr

Anic_an_engineer

Hi, I am Anic an IT Professional . I like to share my knowledge and experience. Thanks for visiting my site.

Please Select Embedded Mode To Show The Comment System.*

أحدث أقدم