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 Kernel
B. The Desktop Environment
C. The Bootloader
D. The Shell

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

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

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

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

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

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

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

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

6 What is the primary function of the sudo command?

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

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. rn
B. rm
C. cp
D. mv

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

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

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. find
B. cat
C. grep
D. locate

13 Which command is used to create a new directory?

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

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. chmod
B. chown
C. usermod
D. chgrp

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

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

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

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

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

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

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

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

21 What is the purpose of the man command?

A. To manually compile code
B. To display the manual/documentation pages for commands
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. create
B. touch
C. make
D. nano

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

A. User: Read/Write; Group: Read; Others: Read
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/Exec; Group: Read/Write; Others: Read/Write

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

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

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

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

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. bottom
B. head
C. less
D. tail

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. A command argument
C. The standard error destination
D. The destination file for standard output

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

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

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

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

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

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

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

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

34 What is the package manager used by Arch Linux?

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

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

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

36 What does the command history do?

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

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

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

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

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

39 What is the function of the cat command?

A. To categorize files
B. To create a directory
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 user is an admin
C. The password is stored in /etc/shadow
D. The account is disabled

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

A. apt delete
B. apt remove
C. apt purge
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. cat /etc/shells
B. ls shell
C. whoami
D. echo $SHELL

44 Which directory contains the device files representing hardware components?

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

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

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

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

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

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

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

48 What does the dpkg command handle?

A. Installing local .deb files
B. Resolving dependencies
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 central storage location for software packages
B. A directory for backup files
C. The kernel source code
D. A user's home folder