wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Linux Command Usage Information

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

What is defined by a Free Software license?

a)

Details of the technical documentation each contributor has to provide.

b)

The programming languages which may be used to extend the licensed program.

c)

A complete list of libraries required to compile the licensed software.

d)

Limits on the purposes for which the licensed software may be used.

e)

Conditions for modifying and distributing the licensed software.

2.

Most commands on Linux can display information on their usage. How can this information typically be displayed?

a)

By running the command with the option /? or /??.

b)

By running the command with the option ?! or ?=!.

c)

By running the command with the option /doc or /documentation.

d)

By running the command with the option -h or --help.

e)

By running the command with the option -m or --manpage.

3.

What happens to a file residing outside the home directory when the file owner's account is deleted?

a)

During a file system check, the file is moved to /lost +found.

b)

The file is removed from the file system.

c)

The UID of the former owner is shown when listing the file's details.

d)

The user root is set as the new owner of the file.

e)

Ownership and permissions of the file remain unchanged.

4.

Which of the following outputs comes from the command free?

a)

A. 21:04:15 up 14 days, 7:43, 3 users, load average: 0.89, 1.00, 0.99

b)

B. avg-cpu: %user %nice %system %iowait %steal %idle 34.04 0.03 13.88 1.06 0.00 50.99

c)

C. Filesystem /dev/mapper/vg_ssd-root 25G 20G 3.6G 85% /

d)

D. 1.8M /tmp

e)

E. total used free shared buff/cache available Mem: 16123128 12565680 2011624 412128 1545824 7180416

5.

A directory contains the following three files: File1.txt File2.txt File3.csv Which command copies the two files ending in .txt to the /tmp/ directory?

a)

A. cp ??.txt /tmp/

b)

B. cp *.txt /tmp/

c)

C. cp .\.txt /tmp/

d)

D. cp ?.txt /tmp/

e)

E. cp $?.txt /tmp/

6.

Members of a team already have experience using Red Hat Enterprise Linux. For a small hobby project, the team wants to set up a Linux server without paying for a subscription. Which of the following Linux distributions allows the team members to apply as much of their Red Hat Enterprise Linux knowledge as possible?

a)

Ubuntu Linux LTS

b)

Raspbian

c)

Debian GNU/Linux

d)

CentOS

e)

openSUSE

7.

The file script.sh in the current directory contains the following content: #!/bin/bash echo $SETVAR The following commands are used to execute this script: SETVAR=value ./script.sh The result is an empty line instead of the content of the variable SETVAR. How should SETVAR be set in order to make script.sh display the content of SETVAR?

a)

!SETVAR=value

b)

env SETVAR=value

c)

SETVAR=value

d)

$SETVAR=value

e)

export SETVAR=value

8.

What are the differences between a private web browser window and a regular web browser window?

a)

A. Private web browser windows do not allow printing or storing websites.

b)

B. Private web browser windows do not store cookies persistently.

c)

C. Private web browser windows do not support logins into websites.

d)

D. Private web browser windows do not keep records in the browser history.

e)

E. Private web browser windows do not send regular stored cookies.

9.

What information can be displayed by top?

a)

Existing files, ordered by their size.

b)

Running processes, ordered by CPU or RAM consumption.

c)

User accounts, ordered by the number of logins.

d)

User groups, ordered by the number of members.

e)

User accounts, ordered by the number of files.

10.

What can be found in the /proc/ directory?

a)

One directory per installed program.

b)

One device file per hardware device.

c)

One file per existing user account.

d)

One directory per running process.

e)

One log file per running service.

11.

A new server needs to be installed. The server should receive important security updates from its Linux distribution. Which of the following Linux distributions meet these requirements?

a)

A. Ubuntu Linux LTS (Long Term Servicing/Support)

b)

B. Fedora Linux

c)

C. Debian GNU/Linux Unstable

d)

D. Ubuntu Linux non-LTS

e)

E. Red Hat Enterprise Linux

12.

Which one of the following statements concerning Linux passwords is true?

a)

All passwords can be decrypted using the system administrator's master password.

b)

Passwords may never start with a non-letter.

c)

Users cannot change their password once it has been set.

d)

Passwords are only stored in hashed form.

e)

Passwords may be at most six characters long.

13.

Which command adds the new user ted and creates the user's home directory with default configuration files?

a)

defaultuser ted

b)

useradd –m ted

c)

usercreate ted

d)

useradd –o default ted

e)

passwd –a ted

14.

Which of the following can you use to exit the program less?

a)

l

b)

x

c)

e

d)

q

e)

!

15.

Which of the following commands extracts the contents of the compressed archive file1.tar.gz?

a)

tar -czf file1.tar.gz

b)

ztar file1.tar.gz

c)

tar -xzf file1.tar.gz

d)

tar --extract file1.tar.gz

e)

detar file1.tar.gz

16.

Which of the following statements regarding Linux hardware drivers is correct?

a)

A. Drivers are regular Linux programs which have to be run by the user who wants to use a device.

b)

B. Drivers are not used by Linux because the BIOS handles all access to hardware on behalf of Linux.

c)

C. Drivers are stored on their devices and are copied by the Linux kernel when a new device is attached

d)

D. Drivers are downloaded from the vendor's driver repository when a new device is attached. (Windows gets from Windows Update)

e)

E. Drivers are either compiled into the Linux kernel or are loaded as kernel modules.

17.

Running the command rm DeleteMe gives the following error: rm: cannot remove ‘DeleteMe’: It’s a directory Which of the following commands can be used instead to remove DeleteMe, assuming DeleteMe is empty?

a)

undir DeleteMe

b)

rmdir DeleteMe

c)

dir –r DeleteMe

d)

rem DeleteMe

e)

rm –r DeleteMe

18.

Which of the following commands adds the directory /new/dir/ to the PATH environment variable?

a)

PATH=/new/dir:PATH=/new/dir: PATH

b)

PATH=/new/dir: PATH

c)

export PATH=/new/dir: PATH

d)

export PATH=/new/dir:PATH=/new/dir: PATH

e)

export PATH=/new/dir: $PATH

19.

Which files can be the sources of the information in the following output? (Choose two.) uid=1000 (ted) gid=1000 (ted) groups=1000 (ted), 10 (wheel), 150(docker)

a)

/etc/id

b)

/etc/passwd

c)

/etc/group

d)

/home/index

e)

/var/db/users

20.

A user is currently in the directory /home/user/Downloads/ and runs the command ls ../Documents/ Assuming it exists, which directory’s content is displayed?

a)

/home/user/Documents/

b)

/home/user/Documents/Downloads/

c)

/home/user/Downloads/Documents/

d)

/Documents/

e)

/home/Documents/

21.

What parameter of ls prints a recursive listing of a directory's content?

a)

-t (time stamps)

b)

-r (reverse order)

c)

-R (recursive)

d)

-a (all)

e)

-l (list long form)

22.

What is true about links in a Linux file system?

a)

A. A symbolic link can only point to a file and not to a directory.

b)

B. A hard link can only point to a directory and never to a file.

c)

C. When the target of the symbolic link is moved, the link is automatically updated.

d)

D. A symbolic link can point to a file on another file system.

e)

E. Only the root user can create hard links.

23.

Reverse DNS assigns hostnames to IP addresses. How is the name of the IP address 198.51.100.165 stored on a DNS server?

a)

In the A record for 165.100.51.198.ipv4.arpA.

b)

In the PTR record for 165.100.51.198.in-addr.arpA.

c)

In the RNAME record for 198-51-100-165.rev.arpA.

d)

In the ARPA record for 165.100.51.198.rev.

e)

In the REV record for arpA.in-addr.198.51.100.165.

24.

Which of the following commands finds all lines in the file operating-systems.txt which contain the term 'linux', regardless of the case?

a)

igrep linux operating-systems.txt

b)

less -i linux operating-systems.txt

c)

grep -i linux operating-systems.txt

d)

cut linux operating-systems.txt

e)

cut [Ll] [Ii] [Nn] [Uu] [Xx] operating-systems.txt

25.

Which of the following commands creates an archive file work.tar from the contents of the directory ./work/?

a)

A. tar --new work.tar ./work/

b)

B. tar –cf work.tar ./work/

c)

C. tar –create work.tgz –content ./work/

d)

D. tar work.tar < ./work/

e)

E. tar work > work.tar

26.

Which of the following values could be a process ID (PID) on Linux?

a)

/bin/bash

b)

60b503cd-019e-4300-a7be-922f074ef5ce

c)

/sys/pid/9a14

d)

fff3

e)

21398

27.

Which of the following statements are true regarding a typical shell script?

a)

It has the executable permission bit set.

b)

It starts with the two character sequence #!.

c)

It is located in /usr/local/scripts/.

d)

It is located in /etc/bash/scripts/.

e)

It is compiled into a binary file compatible with the current machine architecture.

28.

Which command copies the contents of the directory /etc/, including all sub-directories, to /root/?

a)

copy /etc /root

b)

cp -r /etc/* /root

c)

cp -v /etc/* /root

d)

rcp /etc/* /root

e)

cp -R /etc/*.* /root

29.

How is a new Linux computing instance provisioned in an IaaS cloud?

a)

The standard Linux installer has to be run through a remote console.

b)

After buying a Linux distribution, its vendor delivers it to a cloud instance.

c)

The installation has to be prepared in a local virtual machine which is then copied to the cloud.

d)

The cloud hosting organization provides a set of pre-prepared images of popular Linux distributions.

e)

A provider-specific configuration file describing the desired installation is uploaded to the cloud provider.

30.

Which package management tool is used in Red Hat-based Linux Systems?

a)

portage

b)

rpm

c)

apt-get

d)

dpkg

e)

packagectl