wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Linux and vi Text Editor Quiz

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

Which of the following best describes a monolithic kernel like Linux?

a)

Modular with no device drivers

b)

Runs only in user space

c)

All OS services run in kernel space

d)

Loads modules only at boot time

2.

You need to compare two Linux distros for suitability in an embedded system. What criteria is least relevant?

a)

Package manager support

b)

Memory footprint

c)

Upstream kernel version

d)

Community documentation

3.

What component initializes the Linux kernel during system startup?

a)

BIOS

b)

UEFI

c)

Bootloader (e.g., GRUB)

d)

Systemd

4.

What does the “free” command report that top does not by default?

a)

Process CPU usage

b)

Total memory statistics

c)

Load averages

d)

Swap I/O wait

5.

What would be a likely reason for Linux to outperform Windows in a server role?

a)

Gaming optimization

b)

Fewer kernel threads

c)

Lightweight default installs

d)

More aggressive swap usage

6.

What is the result of executing :set number in vi?

a)

Enables word wrap

b)

Highlights syntax

c)

Shows line numbers

d)

Converts tabs to spaces

7.

In command mode, what does 5dd do?

a)

Deletes 5 words

b)

Deletes 5 characters

c)

Deletes 5 lines

d)

Duplicates 5 lines

8.

What is the result of the :!ls command in vi?

a)

Saves and exits

b)

Opens a file browser

c)

Runs a shell command

d)

Lists file contents

9.

How do you append text at the end of the current line in vi?

a)

i

b)

a

c)

A

d)

o

10.

True or False: The vi editor supports both line and visual modes.

a)

True

b)

False

11.

What is the effect of export PATH=$PATH:/custom/bin?

a)

Clears the PATH

b)

Replaces PATH with only /custom/bin

c)

Appends /custom/bin to the PATH

d)

Adds /custom/bin to history

12.

What is the correct syntax for command substitution?

a)

$(command)

b)

${command}

c)

[command]

d)

command |

13.

Which command would you use to detect whether a variable is empty in bash?

a)

if $VAR == ""

b)

if test -z "$VAR"

c)

if -n $VAR

d)

if empty $VAR

14.

What does && do in a command chain?

a)

Redirects output

b)

Pipes input

c)

Executes next command only if previous succeeds

d)

Skips the next command on success

15.

What is the result of echo \ls | wc -l?

a)

Lists files

b)

Displays number of files

c)

Executes in background

d)

Counts directories

16.

Which file defines default group ownership and shell for new users?

a)

/etc/shadow

b)

/etc/default/useradd

c)

/etc/login.defs

d)

/etc/passwd

17.

What does usermod -aG docker bob do?

a)

Adds user bob to docker group

b)

Changes bob's primary group

c)

Appends new shell for bob

d)

Deletes bob from other groups

18.

How do you create a user with a specific UID and no home directory?

a)

useradd -m -u 2001

b)

useradd -u 2001 -M

c)

adduser -U 2001

d)

usermod -U 2001

19.

Which command shows all groups a user belongs to?

a)

users

b)

id

c)

getent

d)

whoami

20.

True or False: The group specified in /etc/passwd is always the user's primary group.

a)

True

b)

False

21.

What is the result of ls -ld /home/user?

a)

Lists contents of /home/user

b)

Shows detailed info of /home/user directory

c)

Lists files recursively

d)

Shows hidden files in the directory

22.

What does the sticky bit do when applied to /tmp?

a)

Prevents deletion by root

b)

Prevents access to subdirectories

c)

Only file owners can delete their files

d)

Encrypts files

23.

Which command will recursively set permissions to 755 for all directories only?

a)

chmod -R 755 *

b)

find . -type d -exec chmod 755 {} ;

c)

chown -R 755 *

d)

chmod --dir 755 .

24.

What command changes group ownership of a file to “developers”?

a)

chmod developers file.txt

b)

chgrp developers file.txt

c)

usermod file.txt developers

d)

setgrp developers file.txt

25.

What does the following mean: -rwsr-xr--?

a)

A directory with sticky bit

b)

File with setuid permission

c)

Script with root capabilities

d)

Group writable binary

26.

What is the purpose of umask?

a)

Applies ACL

b)

Sets default permissions

c)

Masks hidden files

d)

Encrypts user home folders

27.

True or False: The find command can search by file size and modification time.

a)

True

b)

False

28.

Which option with tar ensures ownership and permissions are preserved?

a)

-x

b)

-c

c)

-p

d)

-z

29.

You need to view inode usage of each file. Which command works?

a)

ls -l

b)

df -i

c)

statfs

d)

free -i

30.

What does touch -t 202505302300 file.txt do?

a)

Creates file with current time

b)

Sets access time to 11 PM on May 30, 2025

c)

Changes user time zone

d)

Copies time from another file