wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Linux Commands Quiz - Basic 01 to Basic 02

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.

What does the command `ls` do in Linux?

a)

Starts a service

b)

Lists directory contents

c)

Logs out the user

d)

Shuts down the system

2.

Which symbol is used to refer to the home directory in Linux?

a)

~

b)

/

c)

.

d)

$

3.

Which Linux command is used to change file permissions?

a)

chmod

b)

chdir

c)

mv

d)

touch

4.

What does `pwd` display?

a)

Present working directory

b)

Password file

c)

Protected write directory

d)

Pipe write data

5.

Which user has unrestricted access to all files and commands in Linux?

a)

Admin

b)

Owner

c)

Sudo

d)

Root

6.

What does `cd ..` do in Linux?

a)

Moves into home directory

b)

Goes to previous command

c)

Navigates to the parent directory

d)

Deletes current directory

7.

Which of the following is a Linux text editor?

a)

Notepad

b)

vi

c)

paint

d)

calc

8.

How do you display the contents of a text file in Linux?

a)

show

b)

open

c)

cat

d)

ls

9.

Which command is used to copy files in Linux?

a)

mv

b)

cp

c)

copy

d)

push

10.

Which directory typically contains user home directories?

a)

/etc

b)

/usr

c)

/home

d)

/bin

11.

What is the result of the `mkdir test` command?

a)

Deletes the directory named `test`

b)

Moves into `test` directory

c)

Creates a directory named `test`

d)

Compiles the directory

12.

Which command will show all currently running processes?

a)

kill

b)

ps

c)

echo

d)

ping

13.

Which file stores user account information in Linux?

a)

/etc/accounts

b)

/etc/shadow

c)

/etc/passwd

d)

/etc/group

14.

What does the command `whoami` do?

a)

Changes the user

b)

Displays the username of the current user

c)

Lists all users

d)

Shows the hostname

15.

Which Linux command is used to shut down the system?

a)

shutdown

b)

kill

c)

exit

d)

reboot

16.

Which symbol is used to run a process in the background?

a)

#

b)

&

c)

$

d)

*

17.

Which of the following is a package manager for Debian-based systems?

a)

yum

b)

rpm

c)

apt

d)

zypper

18.

Which file lists the mounted filesystems?

a)

/etc/mount

b)

/etc/fstab

c)

/etc/sudoers

d)

/etc/bashrc

19.

What does the `df` command show?

a)

DNS info

b)

Disk space usage

c)

Directory format

d)

File types

20.

What does `touch` do in Linux?

a)

Opens file editor

b)

Creates an empty file or updates its timestamp

c)

Deletes file

d)

Moves file

21.

Which command is used to find the location of an executable in Linux?

a)

find

b)

where

c)

which

d)

locate

22.

What does the `grep` command do?

a)

Groups files

b)

Searches for text in a file

c)

Edits files

d)

Changes ownership

23.

Which command allows you to monitor real-time system processes?

a)

ps

b)

df

c)

top

d)

uname

24.

How do you extract files from a `.tar.gz` archive?

a)

unzip file.tar.gz

b)

tar -xzf file.tar.gz

c)

gunzip file.tar.gz

d)

extract file.tar.gz

25.

What does the `chmod 755 file` command do?

a)

Gives full access to everyone

b)

Gives read/write/execute to user, and read/execute to group/others

c)

Deletes the file

d)

Removes execute permission

26.

What is the function of the `crontab` command?

a)

Manages timezones

b)

Manages scheduled tasks

c)

Tracks disk usage

d)

Sets password policies

27.

Which command is used to switch users in Linux?

a)

login

b)

sudo

c)

su

d)

who

28.

How can you see hidden files in a directory?

a)

ls -x

b)

ls -a

c)

ls -h

d)

ls -z

29.

What does the `man` command do?

a)

Lists mounted drives

b)

Starts background services

c)

Displays manual pages for commands

d)

Modifies users

30.

Which command in Linux is used to count words, lines, and characters?

a)

count

b)

wc

c)

grep

d)

awk

31.

What does `sudo` stand for?

a)

Superuser domain

b)

Substitute user data override

c)

Superuser do

d)

System under domain operator

32.

What does `&&` do in a command line?

a)

Combines output

b)

Runs commands in parallel

c)

Runs second command only if the first succeeds

d)

Runs command in background

33.

How do you list open network ports in Linux?

a)

ps -e

b)

ip show

c)

netstat -tuln

d)

kill -l

34.

What is the default shell in most modern Linux distributions?

a)

csh

b)

tcsh

c)

bash

d)

ksh

35.

Which command is used to recursively copy directories?

a)

cp -r

b)

mv -f

c)

copy /R

d)

mkdir -p

36.

What does the `/etc/passwd` file contain?

a)

System configurations

b)

Encrypted passwords

c)

User account information

d)

Network info

37.

Which command shows the system’s kernel version?

a)

uname -r

b)

cat /proc/kernel

c)

version -k

d)

top -k

38.

How do you redirect the output of a command to a file (overwrite)?

a)

>>

b)
c)
d)
39.

Which command is used to change file ownership?

a)

chmod

b)

chown

c)

mv

d)

usermod

40.

Which Linux directory contains system logs?

a)

/logs

b)

/sys

c)

/var/log

d)

/usr/logs