wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Linux Interview questions

Total questions: 100

Worksheet time: 50mins

Name
Class
Date
1.

The difference between the df and du commands is:

a)

df shows disk space usage of file systems, while du shows disk usage of files and directories.

b)

df shows memory usage, while du shows CPU usage.

c)

df deletes files, while du updates directories.

d)

df is used for formatting disks, while du is used for defragmenting them.

2.

The scp (secure copy protocol) command in Linux is used for:

a)

Transferring files securely between hosts on a network

b)

Changing file permissions

c)

Monitoring system processes

d)

Editing text files

3.

3. The command that can be used to search for a file on a Linux host is:

a)

find

b)

ls

c)

cd

d)

pwd

4.

The file that contains the iSCSI IQN for a Linux host is:

a)

/etc/iscsi/initiatorname.iscsi

b)

/etc/iscsi/iscsi.conf

c)

/etc/iscsi/iqn.conf

d)

/etc/iscsi/initiator.conf

5.

The following are tools you can use to read a file:

a)

cat , less, vi, vim.

b)

Paint program

c)

Web browser

d)

Calculator

6.

6. The command that can be utilized to determine which process is using the highest CPU and Memory is:

a)

ps aux

b)

ls -l

c)

top

d)

cd /proc

7.

How do you view a list of open files for the host?

a)

lsof

b)

ps

c)

netstat

d)

df

8.

What is the syntax to tar/zip/compress a file? (Fill in the blank)

a)

tar -cvf to create or compress a new archive; tar -xvf to extract or uncompress the archive

b)

tar -zcvf to extract a file; tar -zxvf to compress a file

c)

tar -cvf to delete a file; tar -xvf to rename a file

d)

tar -xvf to create a new archive; tar -cvf to extract the archive

9.

Which command shows the total memory and free memory for the Linux server?

a)

free -m

b)

ls -l

c)

df -h

d)

ps aux

10.

Where can be find the WWPN from a Linux server?

a)

In directory /sys/class/fc_host

b)

In file /etc/hosts

c)

In directory /var/log/wwpn

d)

In command /usr/bin/wwpn

11.

Where would you look to find system logs?

a)

In the /var/log directory

b)

In the /home directory

c)

In the /etc directory

d)

In the /usr/bin directory

12.

If you don't know the options to a command, where do you go to look them up? (Fill in the blank)

a)

In the man pages.

b)

In the recycle bin.

c)

In the downloads folder.

d)

In the task manager.

13.

Which command can be issued to enumerate all users logged into the Linux server?

a)

w

b)

ls

c)

cat

d)

ps

14.

What is an inode in Linux?

a)

When a file is created, an inode is also created to store its metadata. Each file in a Linux system is associated with an inode. Inodes contain information like file size, timestamps, and pointers to data blocks.

b)

An inode is a type of Linux command used to manage user permissions.

c)

An inode is a special type of file that stores the contents of directories only.

d)

An inode is a process that runs in the background to monitor system performance.

15.

Write a command to display the last 10 lines of a file.

a)

tail -n 10 filename.

b)

head -n 10 filename.

c)

cat filename | tail 5

d)

less -n 10 filename.

16.

Which command shows you the file type?

a)

file

b)

cat

c)

ls

d)

grep

17.

Name the file that is used to automatically mount file systems?

a)

/etc/fstab

b)

/etc/hosts

c)

/etc/passwd

d)

/etc/shadow

18.

How do you change the password for a user in Linux?

a)

The “passwd” command is used to change the password for a user in Linux. Running “passwd username” prompts you to enter a new password for the specified user.

b)

The “usermod” command is used to change the password for a user in Linux. Running “usermod -p username” prompts you to enter a new password for the specified user.

c)

The “chuser” command is used to change the password for a user in Linux. Running “chuser password username” prompts you to enter a new password for the specified user.

d)

The “setpass” command is used to change the password for a user in Linux. Running “setpass username” prompts you to enter a new password for the specified user.

19.

How do you view a hidden file in Linux?

a)

ls -a

b)

ls -h

c)

ls --hidden

d)

ls -l

20.

Describe the Process of Starting and Stopping a Service

a)

systemctl start systemctl stop

b)

service start service stop

c)

start-service stop-service

d)

initctl start initctl stop

21.

What are the 3 permission types for Linux?

a)

read, write, and execute

b)

read, delete, and modify

c)

owner, group, and others

d)

create, remove, and update

22.

What is the Linux kernel?

a)

The Linux kernel is the core of the Linux operating system, acting as the central interface between the hardware and the software.

b)

The Linux kernel is a type of computer virus that infects operating systems.

c)

The Linux kernel is a popular web browser used for internet surfing.

d)

The Linux kernel is a programming language used to develop mobile applications.

23.

What are the differences between UNIX and Linux Operating System?

a)

Linux is free and open sourced software.

b)

Linux is a proprietary software developed by Apple.

c)

UNIX is only used for gaming purposes.

d)

Linux cannot be used on servers.

24.

What is linux swap space and when is it used?

a)

Swap space is a designated area on a hard drive (or a dedicated file) that acts as a temporary extension of physical memory (RAM). It's used when the system's RAM is full and needs to free up space for active processes.

b)

Swap space is a special type of RAM that increases the speed of the CPU during heavy computation.

c)

Swap space is a partition used only for storing user files and documents temporarily.

d)

Swap space is a backup area for storing system logs in case of a crash.

25.

The difference between hard links and soft links (symlinks) in Linux is:

a)

Hard links point directly to the inode of a file, while soft links point to the file name.

b)

Soft links can only be created within the same filesystem, while hard links can span filesystems.

c)

Hard links can link to directories, while soft links cannot.

d)

Soft links and hard links are identical in functionality.

26.

The command that can be issued to list the groups you are part of and your UID is:

a)

id

b)

whoami

c)

groups

d)

ls -l

27.

Identify the command used to determine which shell you are using.

a)

echo $SHELL

b)

ls -l

c)

pwd

d)

whoami

28.

The Linux Shell is:

a)

A command-line interface for interacting with the operating system

b)

A type of hardware component in Linux systems

c)

A graphical user interface for Linux games

d)

A programming language used only for web development

29.

Select the correct sequence of steps to create a new user in Linux.

a)

Use the 'useradd' command, set a password with 'passwd', and assign user details as needed.

b)

Edit the /etc/passwd file directly, reboot the system, and assign a password.

c)

Install a new Linux distribution, create a user during installation, and never change it.

d)

Use the 'deluser' command, then set a password with 'passwd', and assign user details.

30.

The distinction between the /etc/passwd and /etc/shadow files is:

a)

/etc/passwd stores user account information, while /etc/shadow stores encrypted passwords.

b)

/etc/passwd stores encrypted passwords, while /etc/shadow stores user account information.

c)

Both files store the same information.

d)

/etc/shadow is used only for system logs.

31.

What are File Permission groups in Linux?

a)

Owner, Group, All Users

b)

Admin, User, Guest

c)

Root, User, System

d)

Primary, Secondary, Tertiary

32.

How can we run a program in the background?

a)

Add the ampersand ( & ) symbol at the end of the command.

b)

Use the exclamation mark ( ! ) at the end of the command.

c)

Type 'runbg' before the command.

d)

Enclose the command in square brackets [ ]

33.

How do we list all processes running in the background?

a)

Run the jobs command. Use fg to bring a process to the foreground.

b)

Use the ps aux command. Use bg to bring a process to the background.

c)

Run the top command. Use kill to terminate a process.

d)

Use the ls command. Use cd to change directories.

34.

What is LVM?

a)

Logical Volume Manager. LVM allows for the collection of multiple physical hard drives and partitions into a single volume group which can then be divided into logical volumes.

b)

Linux Virtual Machine. LVM is a virtualization tool for running multiple operating systems.

c)

Local Volume Mount. LVM is used to mount local drives automatically.

d)

Lightweight Virtual Memory. LVM is a memory management technique.

35.

Different types of volumes you can have with Linux include which of the following?

a)

Physical, Logical, and Network volumes

b)

Only Logical volumes

c)

Only Physical volumes

d)

Only Network volumes

36.

How do you format a disk in Linux?

a)

mkfs.ext4

b)

ls -l

c)

cat /dev/sda

d)

grep disk

37.

What is sudo in Linux? The word "sudo" is the short form of ________ that allows you to run the command with system privileges. With this command, you can get the system's administrative access to perform various tasks. The sudo command requires a password before the execution to verify the user's authorization.

a)

Superuser Do

b)

System User Domain

c)

Super Utility Domain Operator

d)

System Update Download

38.

What is the lsblk command? The command prints all ________ in a tree-like format.

a)

block devices

b)

network interfaces

c)

user accounts

d)

system logs

39.

Linux users place a ./ in front of the script name to:

a)

specify the current directory for execution

b)

run the script as an administrator

c)

indicate a hidden file

d)

compile the script before running

40.

The command that can be issued to list all environmental variables is:

a)

printenv

b)

ls

c)

pwd

d)

cd

41.

A packet trace can be created on a Linux server using which of the following commands?

a)

tcpdump

b)

ping

c)

netstat

d)

traceroute

42.

The wget command is used for which of the following purposes?

a)

Downloading files from the internet

b)

Compressing files

c)

Editing text files

d)

Monitoring system performance

43.

Configuring a static IP address for a Linux server can be done by editing which file?

a)

/etc/network/interfaces

b)

/etc/hostname

c)

/etc/resolv.conf

d)

/etc/fstab

44.

How do you perform a system backup in Linux?

a)

By using the 'tar' command to archive files and directories

b)

By deleting unnecessary files

c)

By formatting the hard drive

d)

By changing file permissions

45.

The purpose of the /etc/hosts file is to:

a)

Map hostnames to IP addresses locally

b)

Store user account information

c)

Configure network interfaces

d)

Log system events

46.

Which command can be used to list latency, utilization and traffic for the disks?

a)

iostat -x

b)

df -h

c)

lsblk

d)

du -sh

47.

What is a process in Linux?

a)

A process is an instance of a running program. It represents the execution of a program in memory and includes information such as the program’s code, data, and resources.

b)

A process is a type of hardware device used to store data in Linux.

c)

A process is a user account with administrative privileges in Linux.

d)

A process is a file format used for saving documents in Linux.

48.

How do you kill a process in Linux?

a)

The “kill” command is used to terminate a process. It requires the process ID (PID) of the process to be killed. The PID can be obtained using the “ps” command.

b)

The “ls” command is used to terminate a process. It requires the process ID (PID) of the process to be killed. The PID can be obtained using the “ps” command.

c)

The “cd” command is used to terminate a process. It requires the process ID (PID) of the process to be killed. The PID can be obtained using the “ps” command.

d)

The “pwd” command is used to terminate a process. It requires the process ID (PID) of the process to be killed. The PID can be obtained using the “ps” command.

49.

Which command can be used to find and replace text in a file?

a)

Sed

b)

Ls

c)

Cat

d)

Pwd

50.

What do the chmod +t and chmod +x commands do? How do they differ from each other?

a)

You can use the chmod +t and chmod +x commands to modify permissions and files on a Linux system.

b)

chmod +t sets the execute permission for all users, while chmod +x sets the sticky bit.

c)

chmod +t removes all permissions from a file, while chmod +x adds read permission.

d)

chmod +t and chmod +x are used to change file ownership, not permissions.

51.

How can you examine a compressed log without having to decompress it first?

a)

use the zcat command

b)

use the cat command

c)

use the less command

d)

use the tail command

52.

You have a file called dsd.log that is almost 4,000 lines long. What text filter can you use to split it into four pieces each 1,000 lines long?

a)

split - The split text filter will divide files into equally sized pieces. The default length of each piece is 1,000 lines.

b)

grep - The grep command is used for searching text using patterns.

c)

cat - The cat command is used to concatenate and display files.

d)

sort - The sort command is used to sort lines of text files.

53.

How do you rename a file in Linux?

a)

mv

b)

cp

c)

renamefile

d)

edit

54.

How to see the list of mounted devices on Linux?

a)

By running command mount -l

b)

By running command ls -a

c)

By running command ps aux

d)

By running command ifconfig

55.

What is the command to see the default gateway?

a)

ip route show

b)

ls -l

c)

ping 8.8.8.8

d)

cat /etc/passwd

56.

When should we use kill -9?

a)

If the process cannot be stopped gracefully we would only use kill -9 as a last resort.

b)

Whenever we want to stop any process, regardless of its state.

c)

To pause a process temporarily.

d)

To restart a process safely.

57.

11. The command used to show a historical listing of the last logged in users is:

a)

last

b)

whoami

c)

ps

d)

ls

58.

The command that can be issued to enumerate the dependencies for a specific file is:

a)

ldd

b)

ls

c)

cat

d)

chmod

59.

The nice command is used for:

a)

Changing the priority of a process

b)

Displaying disk usage

c)

Listing files in a directory

d)

Monitoring network traffic

60.

14. The command used to create a RAID array on a Linux server is:

a)

mdadm

b)

ifconfig

c)

chmod

d)

ps

61.

Changing the hostname for a Linux server can be done using which command?

a)

hostnamectl set-hostname

b)

sudo apt-get update

c)

chmod 755

d)

service restart

62.

16. The fdisk -l output typically displays which of the following?

a)

Partition tables and disk information

b)

Network interface statistics

c)

Running processes and their IDs

d)

System memory usage

63.

15. Steps to create a new RAID Group for Linux include:

a)

Use 'mdadm' to create and manage RAID arrays.

b)

Install RAID hardware only.

c)

Format the drives with NTFS file system.

d)

Use 'chkdsk' to initialize RAID.

64.

Which command shows the file system type each drive has been formatted with?

a)

blkid

b)

lsblk

c)

df

d)

du

65.

Which section of the iostat command shows the read and write latency?

a)

w_await shows the disks write latency. r_await displays the read latency in mS.

b)

%util shows the read and write latency.

c)

svctm shows the read and write latency.

d)

tps shows the read and write latency.

66.

Which command can be issued to search for and install the multithreaded IO generation tool FIO?

a)

dnf search fio dnf install fio.x86_64

b)

yum remove fio yum erase fio.x86_64

c)

apt-get update apt-get remove fio

d)

zypper search fio zypper remove fio

67.

How can we list the servers CPU details including the number of cores?

a)

run command cat /proc/cpuinfo

b)

run command cat /proc/meminfo

c)

run command ls /etc/cpuinfo

d)

run command top -m cpu

68.

How can we check the load average of a linux server? and what is considered high?

a)

The load average can be found in the top or uptime command outputs.

b)

The load average can only be checked by rebooting the server.

c)

The load average is displayed in the /etc/passwd file.

d)

The load average can be checked using the ls command.

69.

3 averages are provided in the load average output for Linux because:

a)

They represent the system load over the last 1, 5, and 15 minutes.

b)

They show the CPU temperature at three different times.

c)

They indicate the number of users logged in at different intervals.

d)

They display the memory usage for three different processes.

70.

The different modes for vi are:

a)

Command mode, Insert mode, and Visual mode

b)

Edit mode, Save mode, and Command mode

c)

Insert mode, Delete mode, and Replace mode

d)

View mode, Edit mode, and Command mode

71.

6. A file or folder can be made hidden in Linux by:

a)

Adding a dot (.) at the beginning of its name

b)

Changing its file extension to .hidden

c)

Moving it to the /hidden directory

d)

Setting its permissions to 000

72.

7. A Linux distribution can be used on a Windows host by:

a)

using Windows Subsystem for Linux (WSL)

b)

installing Linux directly over Windows

c)

using only Windows command prompt

d)

removing Windows and installing Linux

73.

The file that must be edited to allow NFS access is:

a)

/etc/exports

b)

/etc/fstab

c)

/etc/hosts

d)

/etc/nfs.conf

74.

Explain how you would download and install the iscsi initiator for Linux.

a)

Use the package manager to install the open-iscsi package.

b)

Download the iscsi initiator from the official website and run the installer script.

c)

Compile the iscsi initiator from source code only.

d)

Install iscsi initiator by copying binaries from another system.

75.

Which command can be used to scan for open network ports?

a)

nmap

b)

ls

c)

cat

d)

ping

76.

Which command can be used to check if port 80 is open for an external server?

a)

We can use netcat command nc -z -v -s 80

b)

We can use the ping command ping 80

c)

We can use the cp command cp 80

d)

We can use the mkdir command mkdir 80

77.

How do you run a MTU ping test from a Linux based server?

a)

ping -I 192.168.1.154 -M do -s 1472 -w 5 192.168.1.166

b)

ping -t 192.168.1.154 -l 1472 192.168.1.166

c)

ping -m 1472 -d 192.168.1.154 192.168.1.166

d)

ping -S 192.168.1.154 -M do -s 1500 192.168.1.166

78.

What is lsmod?

a)

lsmod is a command-line utility in Linux used to display information about the kernel modules currently loaded into the system, showing which modules are active and their usage status.

b)

lsmod is a Linux command used to list all running processes and their memory usage.

c)

lsmod is a tool for managing user permissions in Linux systems.

d)

lsmod is a command to display disk usage statistics in Linux.

79.

A Zombie is:

a)

processes that have completed their execution, but their entries are not removed from the process table.

b)

a type of fruit

c)

a musical instrument

d)

a kind of weather phenomenon

80.

The following commands can be leveraged to list USB drives:

a)

lsusb and fdisk -l

b)

ping and traceroute

c)

mkdir and rmdir

d)

ps and top

81.

7. To enumerate a list of all user accounts added to the Linux server, which command should be used?

a)

cat /etc/passwd

b)

ls /home

c)

whoami

d)

ps aux

82.

The Linux directory structure includes directories such as /bin and /etc. What do these directories typically contain?

a)

/bin contains essential user command binaries, and /etc contains configuration files.

b)

/bin contains user home directories, and /etc contains log files.

c)

/bin contains temporary files, and /etc contains device drivers.

d)

/bin contains system libraries, and /etc contains executable scripts.

83.

The Linux boot process involves which of the following sequences?

a)

BIOS/UEFI → Bootloader → Kernel → Init/Systemd → Runlevel programs/services

b)

Kernel → BIOS/UEFI → Bootloader → Init/Systemd → Runlevel programs/services

c)

Bootloader → BIOS/UEFI → Kernel → Init/Systemd → Runlevel programs/services

d)

BIOS/UEFI → Kernel → Bootloader → Runlevel programs/services → Init/Systemd

84.

LVM is:

a)

Logical Volume Manager

b)

Linux Virtual Machine

c)

Local Volume Management

d)

Large Volume Module

85.

To append two files and not overwrite the existing data, which file mode should be used?

a)

Use >> (two greater than symbols)

b)

Use the write mode ("w")

c)

Use the read mode ("r")

d)

Use the exclusive creation mode ("x")

86.

How do you create a support log bundle for a Linux server?

a)

We run the sosreport command which will compress all logs and place the output in /var/tmp.

b)

We use the tar command to archive the /etc directory only.

c)

We run the dmesg command and save its output to /tmp/log.txt.

d)

We use the cp command to copy /var/log to /home/user/logs.

87.

Which command can be viewed to list all open network ports on the server?

a)

netstat -tuln

b)

ls -l

c)

df -h

d)

ps aux

88.

Provide a command to change the user ownership of a file.

a)

chown filename

b)

chmod filename

c)

usermod filename

d)

chgrp filename

89.

How would you troubleshoot a DNS issue?

a)

1. View /etc/resolv.conf to verify the DNS servers have been added. 2. Confirm the DNS servers are available over the network with ping. 3. run nslookup against the hostname to see if its being resolved properly. 4. verify DNS port 53 is open with netcat and or with firewall-cmd. 5. Inspect logs or collect a packet trace with tcpdump.

b)

Check the system time and date settings only.

c)

Reboot the server without checking any configuration.

d)

Update the operating system to the latest version without checking DNS settings.

90.

Which command set is used to manage and install applications for Ubuntu Linux?

a)

apt which stands for Advanced Package Tool

b)

yum which stands for Yellowdog Updater Modified

c)

dnf which stands for Dandified YUM

d)

pacman which stands for Package Manager

91.

Select the command that can be used to show all items for LVM.

a)

pvs to print physical volumes

vgs to print volume groups

lvs to print logical volumes

b)

ls

c)

df

d)

ps

92.

The correct sequence of steps to create an LVM volume is:

a)

Create physical volume, create volume group, create logical volume, format and mount

b)

Create logical volume, create volume group, create physical volume, format and mount

c)

Format and mount, create logical volume, create volume group, create physical volume

d)

Create volume group, create physical volume, create logical volume, format and mount

93.

Select the option that lists some common directories for Linux.

a)

/bin, /etc, /home, /usr

b)

/docs, /win, /mac, /sys

c)

/apple, /windows, /data, /user

d)

/main, /root, /temp, /files

94.

Some popular Linux shells are:

a)

Bash, Zsh, Fish, Tcsh

b)

Notepad, WordPad, Paint, Calculator

c)

Chrome, Firefox, Safari, Edge

d)

Excel, PowerPoint, Access, OneNote

95.

Fill in the blank: The /var directory contains ________.

a)

rapidly changing files like logs

b)

user home directories

c)

system kernel files

d)

device drivers

96.

Fill in the blank: The /boot directory contains ________.

a)

the kernel and files required for the initial boot process

b)

user home directories and personal files

c)

system log files and error reports

d)

temporary files created by running processes

97.

Fill in the blank: The /root directory is the home directory for ________.

a)

the super user

b)

regular users

c)

the guest account

d)

system processes

98.

Fill in the blank: The /etc directory contains ________.

a)

many configuration files

b)

user home directories

c)

system log files

d)

temporary files

99.

Fill in the blank: The /home directory is the home directory for ________.

a)

users

b)

system files

c)

administrators

d)

temporary files

100.

Fill in the blank: The /bin directory contains ________.

a)

binaries or programs

b)

configuration files

c)

user documents

d)

system logs