Labour Day Special Limited Time Flat 70% Discount offer - Ends in 0d 00h 00m 00s - Coupon code: 70spcl

LPI 102-500 LPIC-1 Exam 102 - Part 2 of 2 - version 5.0 Exam Practice Test

Page: 1 / 20
Total 197 questions

LPIC-1 Exam 102 - Part 2 of 2 - version 5.0 Questions and Answers

Question 1

Which of the following commands puts the output of the command date into the shell variable mydate?

Options:

A.

mydate="$(date)"

B.

mydate="exec date"

C.

mydate="$((date))"

D.

mydate="date"

E.

mydate="${date}"

Question 2

What output will the following command produce?

seq 1 5 20

Options:

A.

1

6

1

1

1

6

B.

1

5

10

15

C.

1

2

3

4

D.

2

3

4

5

E.

5

10

15

20

Question 3

Which of the following SQL queries counts the number of occurrences for each value of the field order_type in the table orders?

Options:

A.

SELECT order_type,COUNT(*) FROM orders WHERE order_type=order_type;

B.

SELECT order_type,COUNT(*) FROM orders GROUP BY order_type;

C.

COUNT(SELECT order_type FROM orders);

D.

SELECT COUNT(*) FROM orders ORDER BY order_type;

E.

SELECT AUTO_COUNT FROM orders COUNT order_type;

Question 4

What word is missing from the following SQL statement?

__________ count(*) from tablename;

(Please specify the missing word using lower-case letters only.)

Options:

Question 5

When the command echo $ outputs 1, which of the following statements is true?

Options:

A.

It is the process ID of the echo command.

B.

It is the process ID of the current shell.

C.

It is the exit value of the command executed immediately before echo.

D.

It is the exit value of the echo command.

Question 6

What is the purpose of the file /etc/profile?

Options:

A.

It contains the welcome message that is displayed after login.

B.

It contains security profiles defining which users are allowed to log in.

C.

It contains environment variables that are set when a user logs in.

D.

It contains default application profiles for users that run an application for the first time.

Question 7

Which of the following files, when existing, affect the behavior of the Bash shell? (Choose TWO correct answers.)

Options:

A.

~/.bashconf

B.

~/.bashrc

C.

~/.bashdefaults

D.

~/.bash_etc

E.

~/.bash_profile

Question 8

By default, the contents of which directory will be copied to a new user's home directory when the account is created by passing the -m option to the useradd command? (Specify the full path to the directory.)

Options:

Question 9

What command displays all aliases defined in the current shell? (Specify the command without any path information)

Options:

Question 10

Which command allows you to make a shell variable visible to subshells?

Options:

A.

export $VARIABLE

B.

export VARIABLE

C.

set $VARIABLE

D.

set VARIABLE

E.

env VARIABLE

Question 11

What output will the following command sequence produce?

echo '1 2 3 4 5 6' | while read a b c; do

echo result: $c $b $a;

done

Options:

A.

result: 3 4 5 6 2 1

B.

result: 1 2 3 4 5 6

C.

result: 6 5 4

D.

result: 6 5 4 3 2 1

E.

result: 3 2 1

Question 12

What is the difference between the commands test -e path and test -f path?

Options:

A.

They are equivalent options with the same behaviour.

B.

The -f option tests for a regular file. The -e option tests for an empty file.

C.

Both options check the existence of the path. The -f option also confirms that it is a regular file.

D.

The -f option tests for a regular file. The -e option tests for an executable file.

Question 13

Which of the following configuration files should be modified to set default shell variables for all users?

Options:

A.

/etc/bashrc

B.

/etc/profile

C.

~/.bash_profile

D.

/etc/.bashrc

Question 14

Which directory in /etc is used to keep a sample copy of files and directories for when a new user has a home directory created? (Please provide the full path)

Options:

Question 15

Which of the following commands lists all defined variables and functions within Bash?

Options:

A.

env

B.

set

C.

env -a

D.

echo $ENV

Question 16

Which of the following words is used to restrict the records that are returned from a SELECT SQL query based on a supplied criteria for the values in the records?

Options:

A.

CASE

B.

FROM

C.

WHERE

D.

IF

Question 17

You are looking into a new script you received from your senior administrator. In the very first line you notice a #! followed by a file path. This indicates that:

Options:

A.

The file at that location was used to make the script.

B.

This script provides identical functionality as the file at that location.

C.

This script will self-extract into a file at that location.

D.

The program at that location will be used to process the script.

Question 18

Which of the following SQL statements will select the fields name and address from the contacts table?

Options:

A.

SELECT (name, address) FROM contacts;

B.

SELECT (name address) FROM contacts;

C.

SELECT name, address FROM contacts;

D.

SELECT name address FROM contacts;

Question 19

What keyword is missing from this code sample of a shell script?

____ i in *.txt; do

echo $i

done

Options:

A.

for

B.

loop

C.

until

D.

while

Question 20

How can the existing environment variable FOOBAR be suppressed for the execution of the script./myscript only?

Options:

A.

unset -v FOOBAR;./myscript

B.

set -a FOOBAR="";./myscript

C.

env -u FOOBAR./myscript

D.

env -i FOOBAR./myscript

Question 21

Which of the following are requirements in order to run a shell script like a regular command from anywhere in the filesystem? (Choose THREE correct answers.)

Options:

A.

The user issuing the command must be in the group script.

B.

The script file must be found in the $PATH.

C.

The script file must have the executable permission bit set.

D.

The script must begin with a shebang-line (#!) that points to the correct interpreter.

E.

The file system on which the script resides must be mounted with the option scripts.

Question 22

What benefit does an alias in bash provide?

Options:

A.

It provides faster lookups for commands in the system directory.

B.

It creates a local copy of a file from another directory.

C.

It hides what command you are running from others.

D.

It allows a string to be substituted for the first word of a simple command.

Question 23

What output will the command seq 10 produce?

Options:

A.

A continuous stream of numbers increasing in increments of 10 until stopped.

B.

The numbers 1 through 10 with one number per line.

C.

The numbers 0 through 9 with one number per line.

D.

The number 10 to standard output.

Question 24

Which command makes the shell variable named VARIABLE visible to subshells?

Options:

A.

export $VARIABLE

B.

export VARIABLE

C.

set $VARIABLE

D.

set VARIABLE

E.

env VARIABLE

Question 25

Which of the following is the best way to list all defined shell variables?

Options:

A.

env

B.

set

C.

env -a

D.

echo $ENV

Question 26

When the command echo $$ outputs 12942, what is the meaning of 12942?

Options:

A.

It is the process ID of the echo command.

B.

It is the process ID of the current shell.

C.

It is the process ID of the last command executed.

D.

It is the process ID of the last command which has been placed in the background.

Question 27

After issuing:

function myfunction { echo $1 $2 ; }

in Bash, which output does:

myfunction A B C

Produce?

Options:

A.

A B

B.

A B C

C.

A C

D.

B C

E.

C B A

Question 28

What word is missing from the following SQL statement?

insert into tablename ________(909, 'text');

(Please specify the missing word using lower-case letters only.)

Options:

Question 29

Which of the following words is used to restrict the records that are returned from a SELECT query based on a supplied criteria for the values in the records?

Options:

A.

LIMIT

B.

FROM

C.

WHERE

D.

IF

Question 30

For accessibility assistance, which of the following programs is an on-screen keyboard?

Options:

A.

xkb

B.

atkb

C.

GOK

D.

xOSK

Question 31

Which file used by XDM specifies the default wallpaper?

Options:

A.

/etc/X11/xdm/Xsetup

B.

/etc/X11/xdm.conf

C.

/etc/X11/xdm/Defaults

D.

/etc/X11/defaults.conf

Question 32

On a system running the KDE Display Manager, when is the /etc/kde4/kdm/Xreset script automatically executed?

Options:

A.

When KDM starts

B.

When a user's X session exits

C.

When KDM crashes

D.

When X is restarted

E.

When X crashes

Question 33

An administrator wants to determine the geometry of a particular window in X, so she issues the __________ -metric command and then clicks on the window.

Options:

Question 34

Which of the following commands shows the current color depth of the X Server?

Options:

A.

xcd

B.

xcdepth

C.

xwininfo

D.

xcolordepth

E.

cat /etc/X11

Question 35

What is the default name of the configuration file for the Xorg X11 server? (Specify the file name only without any path.)

Options:

Question 36

How is a display manager started?

Options:

A.

It is started by a user using the command startx.

B.

It is started like any other system service by the init system.

C.

It is started by inetd when a remote hosts connects to the X11 port.

D.

It is started automatically when a X11 user logs in to the system console.

Question 37

What is the purpose of the Sticky Keys feature in X?

Options:

A.

To assist users who have difficulty holding down multiple keys at once

B.

To prevent repeated input of a single character if the key is held down

C.

To ignore brief keystrokes according to a specified time limit

D.

To repeat the input of a single character

Question 38

What is the name of the simple graphical login manager that comes with a vanilla X11 installation? (Specify ONLY the command without any path or parameters.)

Options:

Question 39

Your senior administrator asked you to change the default background of his machine, which uses XDM. Which file would you edit to achieve this?

Options:

A.

/etc/X11/xdm/Xsetup

B.

/etc/X11/xdm.conf

C.

/etc/X11/xdm/Defaults

D.

/etc/X11/defaults.conf

Question 40

Why is the xhost program considered dangerous to use?

Options:

A.

It makes it difficult to uniquely identify a computer on the network.

B.

It allows easy access to your X server by other users.

C.

It logs sensitive information to syslog.

D.

It makes your computer share network resources without any authentication.

E.

It is a graphical DNS tool with known exploits.

Question 41

What is the purpose of a screen reader?

Options:

A.

It reads text displayed on the screen to blind or visually impaired people.

B.

It reads the parameters of the attached monitors and creates an appropriate X11 configuration.

C.

It displays lines and markers to help people use speed reading techniques.

D.

It manages and displays files that contain e-books.

Question 42

Which of the following are tasks handled by a display manager like XDM or KDM? (Choose TWO correct answers.)

Options:

A.

Start and prepare the desktop environment for the user.

B.

Configure additional devices like new monitors or projectors when they are attached.

C.

Handle the login of a user.

D.

Lock the screen when the user was inactive for a configurable amount of time.

E.

Create an X11 configuration file for the current graphic devices and monitors.

Question 43

X is running okay but you're concerned that you may not have the right color depth set. What single command will show you the running color depth while in X?

Options:

A.

xcd

B.

xcdepth

C.

xwininfo

D.

xcolordepth

E.

cat /etc/X11

Question 44

Which command can be used to investigate the properties for a particular window in X by clicking that window? (Specify ONLY the command without any path or parameters.)

Options:

Question 45

The X11 configuration file xorg.conf is grouped into sections. How is the content of the section SectionName associated with that section?

Options:

A.

It is placed in curly brackets as in Section SectionName { ... }.

B.

It is placed between a line containing Section "SectionName" and a line containing EndSection.

C.

It is placed between the tags

and

D.

It is placed after the row [SectionName].

E.

It is placed after an initial unindented Section "SectionName" and must be indented by exactly one tab character.

Question 46

Which of the following lines is an example of a correct setting for the DISPLAY environment variable?

Options:

A.

hostname:displayname

B.

hostname:displaynumber

C.

hostname/displayname

D.

hostname/displaynumber

E.

hostname

Question 47

Which command should be added to /etc/bash_profile to change the language of messages from an internationalised program to Portuguese (pt)? (Select TWO correct answers)

Options:

A.

export LANGUAGE="pt"

B.

export MESSAGE="pt"

C.

export LANG="pt"

D.

export LC_MESSAGES="pt"

E.

export ALL_MESSAGES="pt"

Question 48

Which of the following fields can be found in the /etc/group file? (Choose THREE correct answers.)

Options:

A.

The list of users that belong to the group.

B.

The home directory of the group.

C.

The name of the group.

D.

The description of the group.

E.

The password of the group.

Question 49

Which TWO statements about crontab are true?

Options:

A.

Every user may have their own crontab.

B.

Changing a crontab requires a reload/restart of the cron daemon.

C.

The cron daemon reloads crontab files automatically when necessary.

D.

hourly is the same as "0 * * * *".

E.

A cron daemon must run for each existing crontab.

Question 50

In which file, if present, must all users be listed that are allowed to use the cron scheduling system? (Specify the full name of the file, including path.)

Options:

Question 51

What is the purpose of the iconv command?

Options:

A.

It converts bitmap images from one format to another such as PNG to JPEG.

B.

It verifies that the root directory tree complies to all conventions from the Filesystem Hierarchy Standard (FHS).

C.

It displays additional meta information from icon files ending in .ico.

D.

It changes the mode of an inode in the ext4 file system.

E.

It converts files from one character encoding to another.

Question 52

Which of the following steps prevents a user from obtaining an interactive login session?

Options:

A.

Run the command chsh -s /bin/false with the user name.

B.

Set the UID for the user to 0.

C.

Remove the user from the group staff.

D.

Add the user to /etc/noaccess.

E.

Create a .nologin file in the user's home directory.

Question 53

The correct crontab entry to execute the script chklog three times per month between 3 p.m. and 5 p.m.:

Options:

A.

* 3,4,5 1 * * chklog

B.

3 3,4,5 1 * * chklog

C.

3 15,16,17 * * * chklog

D.

0 15,16,17 1 * * chklog

E.

* 15,16,17 1 * * chklog

Question 54

Of the ways listed, which is the best method to temporarily suspend a user's ability to interactively login?

Options:

A.

Use passwd -d username to give the user an empty password.

B.

Use chage to expire the user account.

C.

Change the user's password.

D.

Add the command exit to the user's .login file.

Question 55

Which of the following commands should be added to /etc/bash_profile in order to change the language of messages for an internationalized program to Portuguese (pt)?

Options:

A.

export LANGUAGE="pt"

B.

export MESSAGE="pt"

C.

export UI_MESSAGES="pt"

D.

export LC_MESSAGES="pt"

E.

export ALL_MESSAGES="pt"

Question 56

How is the file format of /etc/crontab different from a normal crontab file? (Select TWO correct answers)

Options:

A.

The /etc/crontab file can specify a year field.

B.

A normal crontab file must be installed with the crontab command.

C.

A normal crontab file allows for environment variable substitution.

D.

The /etc/crontab file has a user field for commands.

Question 57

Where are user specific crontabs stored?

Options:

A.

In the database file /etc/crontab.db which is shared by all users.

B.

As individual per-user files within /var/spool/cron.

C.

As individual per-user files in /etc/cron.user.d.

D.

In the .crontab file in the user's home directory.

E.

In the file /var/cron/user-crontab which is shared by all users.

Question 58

Which file specifies the user accounts that can NOT submit jobs via at or batch? (Provide the full path and filename)

Options:

Question 59

A user was not given permission to use the CRON scheduling system. What file needs to be modified to provide that access? (Please specify the full path to the file)

Options:

Page: 1 / 20
Total 197 questions