WorksheetsLinux and vi Text Editor Quiz
Total questions: 30
Worksheet time: 15mins
Which of the following best describes a monolithic kernel like Linux?
Modular with no device drivers
Runs only in user space
All OS services run in kernel space
Loads modules only at boot time
You need to compare two Linux distros for suitability in an embedded system. What criteria is least relevant?
Package manager support
Memory footprint
Upstream kernel version
Community documentation
What component initializes the Linux kernel during system startup?
BIOS
UEFI
Bootloader (e.g., GRUB)
Systemd
What does the “free” command report that top does not by default?
Process CPU usage
Total memory statistics
Load averages
Swap I/O wait
What would be a likely reason for Linux to outperform Windows in a server role?
Gaming optimization
Fewer kernel threads
Lightweight default installs
More aggressive swap usage
What is the result of executing :set number in vi?
Enables word wrap
Highlights syntax
Shows line numbers
Converts tabs to spaces
In command mode, what does 5dd do?
Deletes 5 words
Deletes 5 characters
Deletes 5 lines
Duplicates 5 lines
What is the result of the :!ls command in vi?
Saves and exits
Opens a file browser
Runs a shell command
Lists file contents
How do you append text at the end of the current line in vi?
i
a
A
o
True or False: The vi editor supports both line and visual modes.
True
False
What is the effect of export PATH=$PATH:/custom/bin?
Clears the PATH
Replaces PATH with only /custom/bin
Appends /custom/bin to the PATH
Adds /custom/bin to history
What is the correct syntax for command substitution?
$(command)
${command}
[command]
command |
Which command would you use to detect whether a variable is empty in bash?
if $VAR == ""
if test -z "$VAR"
if -n $VAR
if empty $VAR
What does && do in a command chain?
Redirects output
Pipes input
Executes next command only if previous succeeds
Skips the next command on success
What is the result of echo \ls | wc -l?
Lists files
Displays number of files
Executes in background
Counts directories
Which file defines default group ownership and shell for new users?
/etc/shadow
/etc/default/useradd
/etc/login.defs
/etc/passwd
What does usermod -aG docker bob do?
Adds user bob to docker group
Changes bob's primary group
Appends new shell for bob
Deletes bob from other groups
How do you create a user with a specific UID and no home directory?
useradd -m -u 2001
useradd -u 2001 -M
adduser -U 2001
usermod -U 2001
Which command shows all groups a user belongs to?
users
id
getent
whoami
True or False: The group specified in /etc/passwd is always the user's primary group.
True
False
What is the result of ls -ld /home/user?
Lists contents of /home/user
Shows detailed info of /home/user directory
Lists files recursively
Shows hidden files in the directory
What does the sticky bit do when applied to /tmp?
Prevents deletion by root
Prevents access to subdirectories
Only file owners can delete their files
Encrypts files
Which command will recursively set permissions to 755 for all directories only?
chmod -R 755 *
find . -type d -exec chmod 755 {} ;
chown -R 755 *
chmod --dir 755 .
What command changes group ownership of a file to “developers”?
chmod developers file.txt
chgrp developers file.txt
usermod file.txt developers
setgrp developers file.txt
What does the following mean: -rwsr-xr--?
A directory with sticky bit
File with setuid permission
Script with root capabilities
Group writable binary
What is the purpose of umask?
Applies ACL
Sets default permissions
Masks hidden files
Encrypts user home folders
True or False: The find command can search by file size and modification time.
True
False
Which option with tar ensures ownership and permissions are preserved?
-x
-c
-p
-z
You need to view inode usage of each file. Which command works?
ls -l
df -i
statfs
free -i
What does touch -t 202505302300 file.txt do?
Creates file with current time
Sets access time to 11 PM on May 30, 2025
Changes user time zone
Copies time from another file
