WorksheetsQuiz 2: Process Management (Continuation)
Total questions: 67
Worksheet time: 39mins
What does the command "ps aux" do in Linux?
Lists all processes running on the system
Lists all users currently logged in
Lists all network connections established by the system
Lists all files and directories in the current directory
Which command displays only processes belonging to a given user in tree form?
pstree
pstree -u
pstree -U
pstree --user-only
Which command shows a process’s parent-child relationships interactively?
pkill
pgrep
pstree
ppid
Which command displays only processes matching a user and sorts by CPU?
ps --user
ps -U
ps -u
ps -C
Which command shows background jobs tied to the current shell?
ps -j
jobs
Which command suspends the foreground job in a terminal?
Ctrl+Z
bg
fg
Ctrl+C
Which top key sorts processes by memory usage?
M
P
T
N
Which top key kills a process by entering its PID?
k
q
d
s
What does /proc/
Process accounting logs
Kernel build flags
Human-readable process metadata (state, UIDs, memory)
Network firewall rules
Which command is used to install a package in Ubuntu/Debian?
apt install package_name
apt update
Which command lists all installed packages?
apt list
dpkg -l
apt list --installed
apt show
The command sudo apt upgrade nano will:
Upgrade the Nano package to the newest version.
Install Nano if it is missing.
None of the above.
Fail — apt upgrade doesn’t take a package name argument.
Which command is used to remove a package but keep its configuration files?
apt purge package_name
apt clean
dpkg -i package_name
apt remove package_name
What is the purpose of the "chmod" command in Linux?
To change the ownership of a file or directory
To change the permissions of a file or directory
To create a new file or directory
To change the group membership of a file or directory
What is the effect of the setgid bit on a directory?
Which command grants group write permission using symbolic mode?
chmod g += w file
chmod g + w file
chmod + g w file
chmod w + g file
What does chmod 700 file set?
Owner rwx; group r-x; others ---
Owner rw-; group r--; others r-
Owner rwx; group ---; others ---
Owner r-x; group r-x; others r-x
What does the command "chmod 755 file.txt" do?
Sets the file.txt permission to read and write for the owner, read-only for the group and others
Sets the file.txt permission to read, write and execute for the owner, read and execute for the group and others
Sets the file.txt permission to read and execute for the owner, read-only for the group and others
Sets the file.txt permission to read-only for the owner, group and others
What numeric mode corresponds to rwxr-x---?
760
740
700
Which chgrp command sets group projectgroup recursively on /home/projectX?
chgrp projectgroup -r /home/projectX
chgrp /home/projectX -R projectgroup
chgrp -aR projectgroup /home/projectX
chgrp -R projectgroup /home/projectX
Which command changes group ownership recursively?
groupmod -R dir group
chgrp -R group dir
chown -gR group dir
chmod -G -R group dir
Which permission string shows setgid on a directory?
drwxr-s---
drwxrwxrwx
d---srwx---
drwxrwsr-x
Which command unlocks a previously locked account?
chage -U
usermod -U
loginctl unlock
passwd --unlock
Which command shows a user’s UID, GID, and group memberships?
users -a
id
Which command sets an account expiration date 30 days from now?
passwd -e +30
chage -E $(date -d "+30 days" +%Y-%m-%d)
usermod --expire "+30"
loginctl expire --days=30
Which command changes a user’s login shell?
chlogin -s /bin/bash
setsh /bin/bash
chsh -s /bin/bash
usermod -S /bin/bash
Which command adds a user to a supplementary group without removing existing groups?
usermod -aG
adduser
usermod -G
gpasswd -S
What does passwd
Sets or changes the user’s password
Resets the user’s UID
Switches the login shell
Locks the account immediately
Which command switches to another user’s shell (with authentication)?
Which command runs a single command as root (privileged) if configured?
doas -c
sudo
rootrun
su -c
Which account has full administrative privileges on a Linux system?
admin
root
user
sudoer
Which command traces the network path to a host?
hopscan
tracepath or traceroute
iptrace
route
Which command shows the default gateway in a concise form?
ip addr | grep gateway
ip link | grep default
route --default show
ip route show
The ip command that lists the routing table with protocol/source hints is:
ip route show
ip route list
ip route get
ip route show proto all
Which directory typically contains user authentication logs (with rsyslog)?
/var/log/user.log
/var/log/secure.log
/var/log/security.d
/var/log/auth.log
Where are many system logs stored on Ubuntu-style systems?
/opt/log
/var/log
/etc/logs
/usr/logs
Which command shows the kernel ring buffer messages?
dmesg
kmsg
logger
journalctl -u kernel
Which command shows the last few lines of a growing log in real time?
head -f
less -F
watch -l
tail -f
Which file shows the currently running kernel version on a typical Linux system?
/var/log/kern.log
/proc/version
/etc/os-release
/boot/grub/grub.cfg
Which of the following is not part of process management?
Process creation and deletion
Deadlock handling
File organization
CPU scheduling
The kernel is responsible for:
Memory and process management
Editing text files
File organization
GUI design
Which component of OS handles process synchronization?
Cache controller
CPU scheduler
File system
Kernel
The shell of an operating system is:
The device driver
The user interface
The hardware interface
The kernel
The command line interface in Linux is called:
Desktop
GUI
Terminal
Shell
The most common shell in Linux is:
Bash shell
C shell
Korn shell
Bourne shell
Which of the following is an example of open-source OS?
Windows
macOS
Linux
iOS
Which of the following is not a major component of the Linux operating system?
Shell
Kernel
File System
Browser
The Linux file system organizes data in:
Circular lists
Binary trees
A hierarchical directory structure
Tables only
The double ampersand characters (&&) are used to separate commands to be executed conditionally, where if the command to the left of the ampersands fails, then the command to the right of the ampersands will be executed.
True
False
The semicolon (;) can be used to separate multiple commands to be executed in order.
True
False
How do you count the number of lines, words, and characters in a file?
cat filename
ls -l filename
grep -c filename
wc filename
A directory is used to:
Store file names and metadata
Manage memory
Control devices
Store system files only
What is the difference between a file and a directory in Linux?
A file contains only text while a directory contains multimedia files.
A file cannot be deleted while a directory can be deleted.
A file is a collection of data while a directory is a container for files and other directories.
A file is read-only while a directory is read-write.
What is the purpose of a file descriptor?
To allocate resources to a file
To store file attributes
To uniquely identify a file in the file system
To manage file queues
What is a file?
A type of process
A collection of data or information
A type of device driver
A type of device controller
What is the job of the file manager?
To manage file queues
To allocate resources to files
To translate file system requests to disk operations
All of the above
Which of the following is a type of file allocation method?
Linked allocation
All of the above
Direct allocation
Indexed allocation
What is the purpose of a context switch?
To allocate resources to a process
To load a process into memory
To terminate a process
To save the current state of
Which of the following best defines a process?
A program stored on disk
A system call
A compiled code
A program in execution
Which of the following best defines an Operating System?
A compiler that translates user commands into binary code executed directly by the CPU.
A firmware layer embedded in the hardware that initializes devices and controls memory mapping.
A background utility designed to compress executable files and reduce memory usage.
A collection of system software that manages hardware resources, provides common services for application programs, and ensures controlled process execution.
What is the role of the scheduler in processor management?
To allocate resources to processes
To allocate resources to network operations
To allocate resources to memory
To allocate resources to I/O operations
What is the main function of the kernel in an operating system?
To manage user accounts and passwords
To manage hardware resources and provide services to applications
To provide a graphical user interface (GUI) for the user
To run system backup and recovery procedures
The command man -k is the same as the command apropos.
(a)
True or False: (The statement is not fully visible, but the answer is True.)
True
False
Which command lists groups on the system?
listgroups
cat /etc/group
id -a *
groups --all
Which command shows numeric UIDs/GIDs in ls output?
ls -id
ls -n
ls --ugid
ls --numeric
Which command resumes a stopped job in the background?
disown
fg
jobs
bg
