Unit 1: Linux Ecosystem & Infrastructure - Practice Quiz

CSE325 — Operating Systems Laboratory 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 Which of the following components constitutes the core interface between a computer's hardware and its processes in the Linux ecosystem?

A. The Desktop Environment
B. The Shell
C. The Kernel
D. The Bootloader

2 In the Linux Filesystem Hierarchy Standard (FHS), which directory is primarily used for system-wide configuration files?

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

3 Which command is used to display the absolute path of the current working directory?

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

4 Which flag is used with the ls command to view hidden files (files starting with a dot)?

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

5 Which Linux distribution family uses rpm as its low-level package manager?

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

6 What is the primary function of the sudo command?

A. Update the system software
B. Suspend the current domain
C. Execute a command with superuser (or another user's) privileges
D. Switch to the root user permanently

7 In the context of file permissions, what is the numeric (octal) value of r-x?

A.
B.
C.
D.

8 Which command is used to rename a file or move it to a different directory?

A. cp
B. mv
C. rm
D. rn

9 Which file stores the encrypted user passwords in a modern Linux system?

A. /usr/bin/passwd
B. /etc/group
C. /etc/shadow
D. /etc/passwd

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

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

11 What is the PID (Process ID) of the init process or systemd (the first process started by the kernel)?

A.
B.
C.
D.

12 Which command allows you to search for a specific pattern of text within files?

A. locate
B. grep
C. find
D. cat

13 Which command is used to create a new directory?

A. newdir
B. touch
C. mkfile
D. mkdir

14 In Debian-based systems (like Ubuntu), which command updates the local package index?

A. apt update
B. apt upgrade
C. apt search
D. apt install

15 Which character represents the user's home directory in the shell?

A. .
B. #
C. ~
D. /

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

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

17 Which file contains the definition of user groups and their members?

A. /etc/shadow
B. /etc/users
C. /var/groups
D. /etc/group

18 What does the | (pipe) operator do in the command line?

A. Separates two commands to run sequentially
B. Redirects output to a file
C. Passes the output of one command as input to another
D. Runs a command in the background

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

A. deluser
B. rmuser
C. userdel
D. users-remove

20 Which package manager is the modern successor to yum in Fedora and RHEL distributions?

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

21 What is the purpose of the man command?

A. To display the manual/documentation pages for commands
B. To manually compile code
C. To manage network connections
D. To manage processes

22 Which command creates an empty file or updates the timestamp of an existing file?

A. make
B. create
C. nano
D. touch

23 When using chmod, what does the permission set 755 represent?

A. User: Read/Write/Exec; Group: Read/Write; Others: Read/Write
B. User: Read/Exec; Group: Read/Exec; Others: Read/Exec
C. User: Read/Write/Exec; Group: Read/Exec; Others: Read/Exec
D. User: Read/Write; Group: Read; Others: Read

24 Which directory typically contains variable data files such as logs (/log), mail, and print spools?

A. /proc
B. /opt
C. /var
D. /tmp

25 Which command allows a user to change their own password?

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

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

A.
B.
C.
D.

27 Which command displays the last few lines of a file?

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

28 Which symbol is used as a wildcard to represent any number of characters in a filename?

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

29 In the command ls -l > filelist.txt, what is filelist.txt?

A. An input file
B. The standard error destination
C. The destination file for standard output
D. A command argument

30 Which of the following is NOT a Debian-based Linux distribution?

A. Ubuntu
B. Linux Mint
C. CentOS
D. Kali Linux

31 Which command is used to create a soft (symbolic) link?

A. link
B. ln -s
C. ln
D. cp -l

32 Which file in the /etc directory defines the mapping of hostnames to IP addresses locally?

A. /etc/hosts
B. /etc/network
C. /etc/hostname
D. /etc/resolv.conf

33 Which command is used to add a new group to the system?

A. addgroup
B. mkgroup
C. groupadd
D. newgroup

34 What is the package manager used by Arch Linux?

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

35 Which option in rm allows for the recursive deletion of directories and their contents?

A. -a
B. -r
C. -d
D. -f

36 What does the command history do?

A. Shows the uptime of the system
B. Displays a list of previously executed commands
C. Shows the version history of the kernel
D. Displays file modification history

37 If a user wants to append output to a file without overwriting it, which operator should be used?

A. >>
B. |
C. >
D. 2>

38 Which command allows you to switch to another user account in the terminal?

A. sw
B. user
C. cd
D. su

39 What is the function of the cat command?

A. To create a directory
B. To categorize files
C. To concatenate and display file content
D. To catch errors

40 In the /etc/passwd file, what does the x in the second field represent?

A. No password is set
B. The password is stored in /etc/shadow
C. The account is disabled
D. The user is an admin

41 Which command removes a package on a Debian/Ubuntu system but leaves the configuration files intact?

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

42 What is the standard input (stdin) file descriptor number?

A.
B.
C.
D.

43 Which command would you use to verify which shell you are currently using?

A. whoami
B. cat /etc/shells
C. echo $SHELL
D. ls shell

44 Which directory contains the device files representing hardware components?

A. /sys
B. /dev
C. /mnt
D. /media

45 How do you count the number of lines in a file named data.txt?

A. ls -l data.txt
B. nl data.txt
C. wc -l data.txt
D. count data.txt

46 Which command creates a shortcut command or overrides a command with specific options?

A. link
B. alias
C. export
D. define

47 Which command is used to modify the group membership of an existing user?

A. groupmod
B. chmod
C. chgrp
D. usermod

48 What does the dpkg command handle?

A. Resolving dependencies
B. Installing local .deb files
C. Updating the kernel
D. Downloading from repositories

49 If you want to move up one level in the directory tree, which command do you use?

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

50 What is a 'Repository' in Linux package management?

A. A directory for backup files
B. A user's home folder
C. A central storage location for software packages
D. The kernel source code