Unit 1 - Practice Quiz

CSE325

1 Which component of the Linux operating system is responsible for managing system resources and acting as an interface between hardware and software?

A. Shell
B. Kernel
C. Compiler
D. Desktop Environment

2 Which of the following distributions is directly based on Debian?

A. CentOS
B. Fedora
C. Ubuntu
D. Arch Linux

3 In the Linux File System Hierarchy (FHS), which directory is primarily used for system-wide configuration files?

A. /bin
B. /etc
C. /var
D. /dev

4 What is the primary function of the Shell in Linux?

A. To manage the physical memory
B. To schedule CPU processes
C. To interpret command-line inputs and execute programs
D. To render the Graphical User Interface (GUI)

5 Which Linux distribution family uses the .rpm package format?

A. Debian
B. Arch
C. Red Hat
D. Slackware

6 Which command is used to display the current working directory?

A. ls
B. cwd
C. pwd
D. cd

7 To list all files, including hidden files (those starting with a dot), which flag should be used with the ls command?

A. ls -l
B. ls -a
C. ls -h
D. ls -R

8 Which command is used to change the current directory to the user's home directory?

A. cd ..
B. cd /
C. cd ~
D. cd -

9 What is the result of the command cd ..?

A. Moves to the root directory
B. Moves to the home directory
C. Moves to the previous directory in history
D. Moves one directory up in the hierarchy (parent directory)

10 Which command allows you to create an empty file or update the timestamp of an existing file?

A. mkdir
B. touch
C. cat
D. nano

11 Which operator is used to redirect standard output to a file, overwriting the file if it exists?

A. >>
B. |
C. <
D. >

12 Which command is used to display the contents of a file on the terminal?

A. cat
B. ls
C. echo
D. touch

13 To copy a directory and all its contents recursively, which flag must be used with cp?

A. -f
B. -r
C. -i
D. -v

14 Which command removes a directory that is not empty?

A. rmdir directory_name
B. rm -r directory_name
C. rm directory_name
D. del directory_name

15 What does the mv command do?

A. Only moves files
B. Only renames files
C. Moves or renames files/directories
D. Copies files

16 Which command shows the first 10 lines of a file by default?

A. tail
B. top
C. less
D. head

17 Which symbol is used to pipe the output of one command as input to another command?

A. >
B. &
C. |
D. /

18 What is the correct syntax to search for the string "error" inside logfile.txt?

A. find "error" logfile.txt
B. search "error" logfile.txt
C. grep "error" logfile.txt
D. cat logfile.txt > "error"

19 Which file stores the list of all users on a Linux system?

A. /etc/users
B. /etc/passwd
C. /etc/shadow
D. /etc/group

20 Which file contains the encrypted passwords for users?

A. /etc/passwd
B. /etc/shadow
C. /etc/security
D. /etc/gshadow

21 What is the User ID (UID) of the root user?

A. 1000
B. 1
C. -1
D.

22 Which command allows a standard user to execute a command with superuser (root) privileges?

A. su
B. admin
C. sudo
D. root

23 Which command is used to create a new user account?

A. newuser
B. useradd
C. mkuser
D. usermod

24 If we assign octal permissions 755 to a file, what is the equivalent symbolic representation?

A. -rwxr-xr-x
B. -rwxrwxrwx
C. -rw-r--r--
D. -r-xr-xr-x

25 How do you calculate the octal value for Read and Execute permission (no write)?

A.
B.
C.
D.

26 Which command is used to change the owner of a file?

A. chmod
B. chown
C. chgrp
D. passwd

27 Which command allows you to change a user's password?

A. chpass
B. passwd
C. usermod
D. setpass

28 To add an existing user john to the group developers, which command is appropriate?

A. usermod -aG developers john
B. groupadd john developers
C. useradd -g developers john
D. chmod developers john

29 Which command is used to delete a user account and their home directory?

A. userdel user
B. userdel -r user
C. deluser user
D. rmuser user

30 The file /etc/sudoers is edited safely using which command?

A. nano /etc/sudoers
B. visudo
C. sudoedit
D. vi /etc/sudoers

31 What is a package repository in Linux?

A. A directory where users save their personal files
B. A storage location containing software packages available for installation
C. A specific file containing the Linux Kernel
D. The trash folder for deleted files

32 Which package manager command is used on Ubuntu/Debian systems to update the local package index?

A. apt update
B. apt upgrade
C. apt install
D. dpkg -i

33 Which command actually installs a new version of the packages currently installed on the system (Debian/Ubuntu)?

A. apt update
B. apt upgrade
C. apt refresh
D. apt dist

34 What is the primary package manager for CentOS 7 and RHEL 7?

A. apt
B. yum
C. pacman
D. zypper

35 Which low-level tool is used to manage .deb files directly?

A. rpm
B. dpkg
C. tar
D. make

36 What is a dependency in package management?

A. A software package that is no longer needed
B. A secondary program required for the primary software to function correctly
C. The cost associated with buying enterprise Linux
D. A graphical interface for the command line

37 On an Arch Linux system, which command installs a package?

A. pacman -S package_name
B. apt install package_name
C. yum install package_name
D. dnf install package_name

38 Which command is used to remove a package and its configuration files on Debian-based systems?

A. apt remove
B. apt purge
C. apt delete
D. rm

39 What does the command man ls do?

A. Lists the manual pages available
B. Displays the manual page for the ls command
C. Runs ls in manual mode
D. Creates a new manual entry for ls

40 Which directory contains device files representing hardware components?

A. /hw
B. /dev
C. /proc
D. /sys

41 Which environment variable stores the directories the shell searches for executable commands?

A. $HOME
B. $USER
C. $PATH
D. $SHELL

42 To toggle the execute permission for the group on a file script.sh, which command is used?

A. chmod g+x script.sh
B. chmod u+x script.sh
C. chmod o+x script.sh
D. chmod a+x script.sh

43 What is the function of the history command?

A. Shows the history of system logins
B. Shows the history of file modifications
C. Displays a list of previously executed commands
D. Restores the system to a previous state

44 Which wildcard character represents 'zero or more characters' in filename expansion?

A. ?
B. *
C. #
D. %

45 What is the purpose of the /tmp directory?

A. Stores temporary files that are usually deleted upon reboot
B. Stores template files for user creation
C. Stores temporary internet files only
D. Stores permanent system logs

46 How do you switch to the previous user account you were logged in as?

A. exit
B. back
C. return
D. switch

47 What is the output of the command whoami?

A. The hostname of the computer
B. The group name of the current user
C. The username of the current user
D. The full name of the current user

48 Which file permission set is represented by the octal number 644?

A. rw-r--r--
B. rwxr-xr-x
C. rw-rw-rw-
D. r--r--r--

49 When compiling software from source code, which command typically follows ./configure and make?

A. make install
B. install start
C. apt install
D. run

50 Which of the following is NOT a Linux Desktop Environment?

A. GNOME
B. KDE Plasma
C. XFCE
D. BASH