Linux Flashcards

1
Q

What are the differences between hard disk drives and solid state disks? (Choose two.)

A

Hard disks have a motor and moving parts, solid state disks do not.
Solid state disks provide faster access to stored data than hard disks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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 PTR record for 165.100.51.198.in-addr.arpa

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following types of bus can connect hard disk drives with the motherboard?

A

The SATA bus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

CentOS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What information can be displayed by top?

A

Running processes, ordered by CPU or RAM consumption.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which of the following commands can be used to resolve a DNS name to an IP address?

A

host

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following outputs comes from the command free?

A

Option E

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is true about the dmesg command? (Choose two.)

A

It displays the content of the Linux kernel’s ring buffer
It might not display older information because it was overwritten by newer information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which of the following outputs could stem from the command last?

A

root tty2 Wed May 17 21:11 - 21:11 (00:00)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the UID of the user root?

A

0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which permissions are set on a regular file once the permissions have been modified with the command chmod 654 file.txt?

A

-rw-r-xr–

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is true about the owner of a file?

A

Each file is owned by exactly one user and one group.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which of the following permissions are set on the /tmp/ directory?

A

rwxrwxrwt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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

A

useradd -m tux

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What information is stored in /etc/passwd? (Choose three.)

A

The numerical user ID
The username
The encrypted password

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which of the following tar options handle compression? (Choose two.)

A

-z
-j

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

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

A

tar -cf work.tar ./work/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Which of the following keys can be pressed to exit less?

A

q

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

The current directory contains the following file:
-rwxr-xr-x 1 root root 859688 Feb 7 08:15 test.sh
Given that the file is a valid shell script, how can this script be executed? (Choose two.)

A

./test.sh
bash test.sh

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Which of the following commands sorts the output of the command export-logs?

A

export-logs | sort

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

A directory contains the following files:
a.txt
b.txt
c.cav

What would be the output of the following shell script? for file in *.txt

do
echo $file
done

A

a. txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Which of the following commands will search for the file foo.txt under the directory /home?

A

find /home -name foo.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

The current directory contains the following file:

-rw-r–r– 1 root exec 24551 Apr 2 12:36 test.sh

The file contains a valid shell script, but executing this file using ./test.sh leads to this error:

bash: ./test.sh: Permission denied

What should be done in order to successfully execute the script?

A

The execute bit should be set in the file’s permissions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is a Linux distribution?

A

A bundling of the Linux kernel, system utilities and other software.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Which of the following programs is a graphical editor for vector graphics?

A

Inkscape

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

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

A

rpm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Where is the operating system of a Raspberry Pi stored?

A

On a removable SD card which is put into the Raspberry Pi.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is defined by a Free Software license?

A

Conditions for modifying and distributing the licensed software.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Why are web browser cookies considered dangerous?

A

Cookies support identification and tracking of users.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Which of the following are typical services offered by public cloud providers? (Choose three.)

A

Platform as a Service(PaaS)
Infrastructure as a Service(IaaS)
Software as a Service (SaaS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

Which of the following characters in a shell prompt indicates the shell is running with root privileges?

A

#

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

Which of the following commands are used to get information on the proper use of ls? (Choose two.)

A

man ls
info ls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Which of the following directories contains information, documentation and example configuration files for installed software packages?

A

/usr/share/doc/

33
Q

Running the command rm Downloads leads to the following error:

rm: cannot remove `Downloads/’: Is a directory

Which of the following commands can be used instead to remove Downloads, assuming Downloads is empty? (Choose two.)

A

rmdir Downloads
rm -r Downloads

34
Q

What is true about a recursive directory listing?

A

It includes the content of sub-directories.

35
Q

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

A

export PATH=/new/dir: $PATH

36
Q

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

/Documents/

37
Q

Which of the following DNS record types hold an IP address? (Choose two.)

A

MX
A

37
Q

A directory contains the following three files:

texts 1.txt
texts 2.txt
texts 3.csv

Which command copies the two files ending in .txt to the /tmp/ directory

A

cp *.txt /tmp/

38
Q

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

A

21398

38
Q

Which command displays file names only and no additional information?

A

ls -a

38
Q

Which of the following devices represents a hard disk partition?

A

/dev/sda2

39
Q

What can be found in the /proc/ directory?

A

One directory per running process.

39
Q

Which of the following is a protocol used for automatic IP address configuration?

A

DHCP

39
Q

Which of the following directories must be mounted with read and write access if it resides on its own dedicated file system?

A

/var

39
Q

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

A

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

39
Q

Which of the following commands output the content of the file Texts 2.txt? (Choose two.)

A

cat ‘Texts 2.txt’
cat – Texts 2.txt

40
Q

A new server needs to be installed to host services for a period of several years. Throughout this time, the server should receive important security updates from its Linux distribution.

Which of the following Linux distributions meet these requirements? (Choose two.)

A

Ubuntu Linux LTS
Red Hat Enterprise Linux

40
Q

The ownership of the file doku.odt should be changed. The new owner is named tux. Which command accomplishes this change?

A

chown tux doku.odt

41
Q

What is true about the su command?

A

It runs a shell or command as another user

41
Q

Which statements about the directory /etc/skel are correct? (Choose two.)

A

The files from the directory are copied to the home directory of a new user when the account is created.
The directory contains the global settings for the Linux system.

42
Q

What happens to a file residing outside the home directory when the file owner’s account is deleted?
(Choose two.)

A

The UID of the former owner is shown when listing the file’s details.
Ownership and permissions of the file remain unchanged.

43
Q

Which of the following commands shows the absolute path to the current working directory?

A

pwd

43
Q

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 -m or –manpage

44
Q

Which files are the source of the information in the following output? (Choose two.)
uid=1000 (bob) gid=1000 (bob) groups=1000 (bob), 10 (wheel), 150 (wireshark), 989 (docker), 1001 (libvirt)

A

/etc/passwd
/etc/group

44
Q

What is true about links in a Linux file system?

A

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

44
Q

Which of the following commands puts the lines of the file data.csv into alphabetical order?

A

sort data.csv

45
Q

Which of the following tasks can the command passwd accomplish? (Choose two.)

A

Create a new user account.
Lock a user account

45
Q

What is the purpose of the PATH environment variable?

A

It allows the execution of commands without the need to know the location of the executable.

46
Q

Which of the following commands sets the variable USERNAME to the value bob?

A

USERNAME=bob

46
Q

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

A

cp -r /etc/* /root

46
Q

Which of the following examples shows the general structure of a for loop in a shell script?

A

for file in *.txt
do
echo $i
done

47
Q

!/bin/bash

The file script.sh in the current directory contains the following content:

echo $MYVAR

The following commands are used to execute this script:

MYVAR=value
./script.sh

The result is an empty line instead of the content of the variable MYVAR. How should MYVAR be set in order to make script.sh display the content of MYVAR?

A

export MYVAR=value

47
Q

Which operator in a regular expression matches the preceding character either zero or one time?

A

?

47
Q

What is the preferred source for the installation of new applications in a Linux based operating system?

A

The distribution’s package repository

47
Q

Which of the following statements are true regarding a typical shell script? (Choose two.)

A

It has the executable permission bit set
It is compiled into a binary file compatible with the current machine architecture.

47
Q

What keyword is used in a shell script to begin a loop? (Specify one keyword only, without any additional information.)

A

for

48
Q

What is the return value of a shell script after successful execution?

A

0

48
Q

Which of the following commands creates the ZIP archive poems.zip containing all files in the current directory whose names end in .txt?

A

zip poems.zip *.txt

49
Q

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

A

grep -i linux operating-systems.txt

49
Q

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

A

tar -xzf file1.tar.gz

50
Q

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

A

Passwords are only stored in hashed form

51
Q

Which of the following programs are web servers? (Choose two.)

A

Apache HTTPD
NGINX

51
Q

Which of the following Linux Distributions is derived from Red Hat Enterprise Linux?

A

CentOS

52
Q

Which of the following statements is true about Free Software?

A

It may be modified by anyone using it.

52
Q

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

A

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

53
Q

What are the differences between a private web browser window and a regular web browser window? (Choose three.)

A

Private web browser windows do not store cookies persistently
Private web browser windows do not keep records in the browser history
Private web browser windows do not send regular stored cookies

54
Q

What command displays manual pages? (Specify ONLY the command without any path or parameters.)

A

man

54
Q

When typing a long command line at the shell, what single character can be used to split a command across multiple lines?

A

\

54
Q

What parameter of ls prints a recursive listing of a directory’s content? (Specify ONLY the option name without any values or parameters.)

A

ls -R