wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Linux Quiz

Total questions: 60

Worksheet time: 45mins

Name
Class
Date
1.

Linux is a:

a)

Programming language

b)

Operating System

c)

Web Browser

d)

Database

2.

Which of the following are Linux distributions?

a)

Ubuntu

b)

Windows 10

c)

macOS

d)

Debian

e)

Solaris

3.

Which command lists files in Linux?

a)

list

b)

show

c)

display

d)

ls

e)

cd ..

4.

Which command is used to change file permissions?

a)

perm

b)

chmod

c)

chperm

d)

changeperms

5.

Which command shows the current directory?

a)

whereami

b)

currdir

c)

pwd

d)

cd

e)

dir

6.

The superuser in Linux is called:

a)

admin

b)

user

c)

master

d)

root

7.

Which command is used to copy files?

a)

copy

b)

mv

c)

cp

d)

cpfile

e)

cpy

8.

To remove a file, we use:

a)

delete

b)

rm

c)

erase

d)

rm -r

e)

removefile

9.

Which command is used to move or rename a file?

a)

mvfile

b)

movefile

c)

rename

d)

cp

e)

mv

10.

Which command is used to search for text in files?

a)

search

b)

findtext

c)

grep

d)

textfind

11.

Which command is used to view running processes?

a)

ps

b)

procview

c)

showproc

d)

procs

12.

To terminate a process, which command is used?

a)

stop

b)

terminate

c)

end

d)

exit

e)

kill

13.

Which directory contains user home directories?

a)

/sys

b)

/boot

c)

/home

d)

/bin

e)

/root

14.

The command to change directory is:

a)

chdir

b)

changedir

c)

cd

d)

go

e)

cd ..

15.

The command df is used to:

a)

Show files

b)

Download files

c)

Check disk space

d)

Format disks

16.

Which of the following is a package manager in Ubuntu?

a)

yum

b)

rpm

c)

npm

d)

brew

e)

apt

17.

What is the full form of GUI?

a)

Graph Use Instruction

b)

Graphical User Interface

c)

Global User Identity

d)

Graphical Unix Interface

18.

Which command is used to create a directory?

a)

makedir

b)

createdir

c)

newdir

d)

mkdir

19.

Linux file system starts from:

a)

Root /

b)

/home

c)

/root

d)

/sys

20.

To display full content of a file, use:

a)

head

b)

tail

c)

cat

d)

fileopen

e)

readfile

21.

Which one is not a Linux distribution?

a)

Fedora

b)

CentOS

c)

Windows

d)

Kali

22.

To display real-time system resource usage:

a)

stat

b)

top

c)

showproc

d)

sysview

23.

To get help about a command:

a)

helpme

b)

assist

c)

guide

d)

man

24.

Linux is mostly written in:

a)

Java

b)

Python

c)

C

d)

C++

25.

Which command shows logged in users?

a)

usershow

b)

loginlist

c)

who

d)

userstatus

26.

Default editor in most Linux distros:

a)

vi

b)

nano

c)

code

d)

gedit

27.

Which command is used to update installed packages in Ubuntu?

a)

apt-check

b)

sudo apt-get

c)

sudo apt update

d)

pkgupdate

e)

refresh

28.

Which command allows switching to the root user?

a)

rootlogin

b)

sudo

c)

sudo su

d)

sudo u

e)

sudo -admin

29.

Which command displays the first 10 lines of a file by default?

a)

tail

b)

nl

c)

less

d)

seq

e)

head

30.

Which command shows the last 10 lines of a file by default?

a)

head

b)

tail

c)

bottom

d)

less

e)

sq

31.

Which command is used to print numbers in sequence (e.g., 1 2 3 4 5)?

a)

nl

b)

seq

c)

sequence

d)

cut

32.

Which command adds line numbers to the lines of a file?

a)

tail

b)

head

c)

echo

d)

seq

e)

nl

33.

Which of the following displays lines 5 to 15 of a file?

a)

head -n 15 file | tail -n 11

b)

tail -n 15 file | head -n 11

c)

nl file | head -n 15

d)

head -n 10 file | tail -n 5

34.

Which command will print numbers from 10 to 50, with a step of 10?

a)

sudo seq 10 50

b)

seq -s 10 50

c)

nl 10 10 50

d)

seq 10 50

e)

seq 10 10 50

35.

head -n -5 file.txt

a)

Skips last 5 lines and shows rest

b)

Displays first 5 lines

c)

Displays only last 5 lines

d)

Gives an error

36.

Which command is used to copy files from one location to another?

a)

mv

b)

cp

c)

cut

d)

copy

37.

Which option with cp copies directories recursively?

a)

-d

b)

-r

c)

-p

d)

-l

38.

Which command will rename a file called old.txt to new.txt?

a)

cp old.txt new.txt

b)

rename old.txt new.txt

c)

mv old.txt new.txt

d)

head old.txt > new.txt

39.

Which command creates an empty file or updates the timestamp of a file?

a)

echo file

b)

touch file

c)

cat > file

d)

echo hello world > index.txt

40.

What does cp file1.txt file2.txt do?

a)

Deletes file1.txt and creates file2.txt

b)

Moves file1.txt to file2.txt

c)

Merges two files into one

d)

Copies the contents of file1.txt to file2.txt

41.

Which two commands will show hidden files in a directory?

a)

ls -l

b)

ls -a

c)

ls

d)

ls -la

42.

Which two options can you use with ls to show files with more details and including hidden files?

a)

ls -l

b)

ls -al

c)

ls -a

d)

ls -la

43.

What is the purpose of the sudo command in Linux?

a)

Switch to another user

b)

Run commands with superuser (root) privileges

c)

Create new users

d)

Change file ownership

44.

Which command allows you to edit files like /etc/hosts with proper permissions?

a)

sudo vi /etc/hosts

b)

nano /etc/hosts

c)

sudo nano /etc/hosts

d)

echo hello world > /etc/hosts

e)

touch /etc/hosts

45.

Which two commands will update system packages (Debian/Ubuntu)?

a)

sudo yum update

b)

sudo apt update

c)

sudo pacman -Syu

d)

sudo apt upgrade

46.

How do you reboot a Linux system using sudo?

a)

sudo shutdown -r now

b)

sudo restart

c)

sudo reboot

d)

sudo halt

47.

Rename image.png to logo.png

(a)  

48.

Create an empty file called notes.txt

(a)  

49.

Delete a file called oldfile.txt

(a)  

50.

Show last 20 lines of a file called data.txt

(a)  

51.

Copy file1.txt to backup/ directory

(a)  

52.

Move report.txt to the documents/ directory

(a)  

53.

Generate a sequence from 1 to 10

(a)  

54.

Run apt update with root privileges

(a)  

55.

Delete a directory called testdir

(a)  

56.

Change directory to Documents folder:

(a)  

57.

Go back to the previous (parent) directory:

(a)  

58.

Go to the home directory from anywhere:

(a)  

59.

List files with details and hidden files:

(a)  

60.

List files in the current directory:

(a)