wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Linux2 - Lesson 6 (exam training)

Total questions: 40

Worksheet time: 22mins

Name
Class
Date
1.

What command is used to view all variables, local and global?

a)

env

b)

var

c)

echo $var

d)

print $env

2.

What is the use of file /etc/hosts on a linux system?

a)

To map any relevant IP to a hostname

b)

To map any Ip to its relevant IP

c)

To map any hostname to its relevant IP

d)

To map any hostname to its hostname

3.

What file is the configuration file for Samba?

a)

/var/etc/smb.conf

b)

/etc/network/smb.conf

c)

/var/log/smb.conf

d)

/etc/samba/smb.conf

4.

Default Apache stores it's HTML content pages in:

a)

/etc/www

b)

/apache/www

c)

/var/www

d)

/var/www/html

5.

How can I edit a cronjob?

a)

crontab -l

b)

crontab

c)

crontab -e

d)

crontab -m

6.

When using the ping command, how many packets (count) would be sent?

a)

0

b)

1

c)

64

d)

indefinite

7.

What is the DIG command in Linux used for?

a)

Query the hostname

b)

Setup the network

c)

Querying name servers

d)

Check for connectivity

8.

IPv6 is a 128 bit numeric representation of devices over Internet. It supports how many addresses? (Choose 2)

a)

340 trillion, trillion, trillion unique IP address.

b)

340 million, million, million, million unique IP address

c)

340 thousand unique IP address

d)

2 pow(128) unique IP address

9.

In Linux, drivers are referred to as?

a)

Components

b)

Segments

c)

Kernels

d)

Modules

10.

The commands 'ifconfig' and 'ip' can do the exact same things but with different switches (true or false)

a)

true

b)

false

11.

In what situation would an alias in a network be appropriate?

a)

When there is only one IP address needed for a machine.

b)

When you do not like the name of the interface as it exists

c)

When the Linux server needs to talk to a Windows workstation

d)

When you need to have a single host with more than one IP address assigned to the same interface.

12.

What is the protocol that is used for applications where the packet sender does not need to guarantee successful delivery of the data.

a)

TCP

b)

ARP

c)

UDP

d)

SNMP

13.

A system’s______is the friendly name by which other systems or applications can address the system on a network.

a)

domainname

b)

ip-adress

c)

hostname

d)

mac-adress

14.

How to check the default route and routing table?

(more answers can be correct)

a)

route -n

b)

netstat -rn

c)

ip route show

d)

traceroute

15.

How to check which ports are listening in my Linux Server?

a)

tracert

b)

netstat - tulpen

c)

port -l

d)

ip a

16.

What is a correct command for assigning an IP-adress to a NIC?

a)

Ifconfig eth0 172.16.25.130

b)

Ifconfig eth0 -c 172.16.25.130

c)

ifconfig -ip 172.16.25.130

d)

Ifconfig eth0 down; Ifconfig eth0 172.16.25.130; Ifconfig eth0 up

17.

The route cache is a kernel component enabling route lookups to be faster by caching the results in a table. What command to use to check the kernel routing info?

a)

route

b)

route -n

c)

traceroute

d)

route -Cn

18.

What is the correct syntax for a Secure Copy command, to copy the file "foobar.txt" from the local host to a remote host?

a)

scp foobar.txt your_username@remotehost.edu:/some/remote/directory

b)

scp foobar.txt remotehost.edu:/some/remote/directory -u your_username

c)

your_username@remotehost.edu:/some/remote/directory foobar.txt

d)

scp -u your_username@remotehost.edu:/some/remote/directory foobar.txt

19.

What command can be used to force a password change at next login for the user TESTUSER?

a)

passwd –e TESTUSER

b)

passwd -f TESTUSER

c)

passwd -np TESTUSER

d)

passwd -p TESTUSER

20.

What is a correct syntax when using the 'chown' command (more answers can be correct)

a)

chown <filename> <new owner)

b)

chown user:group <filename>

c)

chown user: <filename>

d)

chown 777 <filename>

21.

When coding a Linux script; a conditional statements can be used to see: (Multiple correct answers)

a)

if two string variables or values match (or not)

b)

if two numeric variables or values match (or not)

c)

if a previous step of your script has ended abnormaly

d)

the status of files (if they exist, are a directory, etc)

22.

What is a correct Linux command to check if the Samba service is running?

a)

systemctl status smbd

b)

smb - check

c)

samba -check

d)

service status smb

23.

Which port is the default SSH port?

a)

9999

b)

22

c)

2222

d)

8080

24.

What is the name of the package manager on Red Hat Linux system

a)

yum

b)

grub

c)

rpm

d)

apt

25.

What is a correct syntax to connect to a mysql database called ‘mydb’ with the root user?

a)

mysql mydb -u root

b)

mysql –u root –p mydb

c)

mysql -db mydb -u root

d)

mysql connect mydb -u root

26.

What will happen if you enter ‘dmesg’ on the command prompt under the Root user?

a)

You will enter te DiskMessages menu, for Storage configuration

b)

You sent direct messages to all logged-in users on the system

c)

You will see the direct messages, which are normally shown when you log in.

d)

You can view the Kernel ring buffer for debugging issues

27.

what command can be used in a script to show a blank screen

a)

clean

b)

clear

c)

clr

d)

cln

28.

What command do you use to create a ‘shortcut’ for a file or directory

a)

sc

b)

cp -sc

c)

ln

d)

cp -link

29.

What command can you use to check who is logged on, on your Linux server?

(one or more commands might be correct)

a)

id

b)

who

c)

w

d)

cat /etc/login

e)

login

30.

In VI which command saves your edited file and end the VI-editor?

a)

quit <enter>

b)

endsave <enter>

c)

wq! <enter>

d)

se <enter>

31.

What command do you use to display the last 25 commands issued under the current user and write to a file /tmp/last25cmds?

a)

last | grep 25 | /tmp/last25cmds

b)

echo $lastcommand | grep 25 > /tmp/last25cmds

c)

last -25 | cat /tmp/last25cmds

d)

history | tail -25 > /tmp/last25cmds

32.

The correct command to create a compressed tar-ball named ‘tarbal.tgz’ of the directory ‘files’ ? (asuming that the directory is present in current working directory)

a)

tar -f tarbal.tgz files

b)

tar -czf tarbal.tgz files

c)

tar -compress /files tarball.tgz

d)

tar -xf tarball.tgz /files

33.

After making multiple unsaved edits to a text file using Vim, what command allows exiting the editor without keeping the changes?

a)

:quit

b)

:x

c)

:wq!

d)

:q!

34.

The permission -rwxr--r-- represented in octal expression will be

a)

777

b)

744

c)

666

d)

711

35.

how to change your current working directory to one-level higher (eg: from /var/home/ to /var)

a)

cd

b)

cd ~

c)

cd ..

d)

cd !

36.

A correct command to shutdown your Linux-server:

a)

sudo shutdown -h now

b)

sudo -sh

c)

sudo hold

d)

sudo reboot -h

37.

how to start a script, assuming it has execute-rights and exists in the current directory

a)

/<scriptname>

b)

.<scriptname>

c)

./<scriptname>

d)

exec <scriptname>

38.

when using the command 'sudo cp -R /tmp/* .' in your home-directory what will happen?

a)

all files from /tmp will be copied into your home-dir in reverse order

b)

all read-only files from /tmp will be copied to your home-dir

c)

all subdirectories inside /tmp will be copied to your home-dir

d)

/tmp and all subdirectories inside will be copied to your home-dir

39.

The correct command in Linux to restart the SSH daemon is:

a)

systemctl ssh restart

b)

sudo service restart sshd

c)

sshd restart now

d)

sudo systemctl restart ssh

40.

What command to reboot a Linux server of VM, when working under the root-user?

a)

reboot now

b)

restart now

c)

kernal -r now

d)

os-restart now