CompTIA Linux+ [Powered by LPI] - Exam 2

QUESTION NO: 1

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

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

Answer: A

QUESTION NO: 2

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

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.

Answer: C

QUESTION NO: 03

What word is missing from the following SQL statement?

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

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

Answer: VALUES, values

QUESTION NO: 4

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

A. export $VARIABLE

B. export VARIABLE

C. set $VARIABLE

D. set VARIABLE

E. env VARIABLE

Answer: B

QUESTION NO: 5

What output will the command seq 10 produce?

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.

Answer: B

QUESTION NO: 6

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.)

Answer: /etc/skel

QUESTION NO: 7

What word is missing from the following SQL statement?

__________ count(*) from tablename;

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

Answer: select

QUESTION NO: 8

After issuing:

function myfunction { echo $1 $2 ; }

in Bash, which output does:

myfunction A B C

Produce?

A. A B

B. A B C

C. A C

D. B C

E. C B A

Answer: A

QUESTION NO: 9

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

A. mydate="$(date)"

B. mydate="exec date"

C. mydate="$((date))"

D. mydate="date"

E. mydate="${date}"

Answer: A

QUESTION NO: 10

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

A. ~/.bashconf

B. ~/.bashrc

C. ~/.bashdefaults

D. ~/.bash_etc

E. ~/.bash_profile

Answer: B, E

QUESTION NO: 11

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

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.

Answer: C

QUESTION NO: 12

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

A. unset -v FOOBAR;./myscript

B. set -a FOOBAR="";./myscript

C. env -u FOOBAR./myscript

D. env -i FOOBAR./myscript

Answer: C

QUESTION NO: 13

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

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.

Answer: B

QUESTION NO: 14

What output will the following command produce?

seq 1 5 20

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

Answer: A

QUESTION NO: 15

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?

A. CASE

B. FROM

C. WHERE

D. IF

Answer: C

QUESTION NO: 16

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

A. env

B. set

C. env -a

D. echo $ENV

Answer: B

QUESTION NO: 17

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

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;

Answer: B

QUESTION NO: 18

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

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.

Answer: C

QUESTION NO: 19

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

Answer: alias, alias -p

QUESTION NO: 20

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.)

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.

Answer: B, C, D

Topic 2, User Interfaces and Desktops

QUESTION NO: 1

Which file used by XDM specifies the default wallpaper?

A. /etc/X11/xdm/Xsetup

B. /etc/X11/xdm.conf

C. /etc/X11/xdm/Defaults

D. /etc/X11/defaults.conf

Answer: A

QUESTION NO: 2

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.)

Answer: /usr/bin/xwininfo, xwininfo

QUESTION NO: 3

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

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 <Section name="SectionName"> and </Section>

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.

Answer: B

QUESTION NO: 4

What is the purpose of a screen reader?

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.

Answer: A

QUESTION NO: 5

How is a display manager started?

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.

Answer: B

QUESTION NO: 6

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

Answer: xorg.conf

QUESTION NO: 7

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

A. xcd

B. xcdepth

C. xwininfo

D. xcolordepth

E. cat /etc/X11

Answer: C

QUESTION NO: 8

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

A. xkb

B. atkb

C. GOK

D. xOSK

Answer: C

QUESTION NO: 9

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.)

Answer: xdm

QUESTION NO: 10

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

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.

Answer: A, C

Topic 3, Administrative Tasks

QUESTION NO: 1

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

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.

Answer: A

QUESTION NO: 2

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

Answer: /etc/at.deny

QUESTION NO: 3

Which character in the password field of /etc/passwd is used to indicate that the encrypted password is stored in /etc/shadow?

A. *

B. -

C. s

D. x

Answer: D

QUESTION NO: 44

The system's timezone may be set by linking /etc/localtime to an appropriate file in which directory? (Provide the full path to the directory, without any country information)

Answer: /usr/share/zoneinfo/

QUESTION NO: 5

Which of the following fields are available in both the global /etc/crontab file as well as in user-specific crontab files? (Select TWO correct answers)

A. Year

B. Minute

C. Username

D. Command

Answer: B, D

QUESTION NO: 6

Which command can be used to delete a group from a Linux system?

A. groupdel

B. groupmod

C. groups

D. groupedit

Answer: A

QUESTION NO: 7

What is the purpose of the iconv command?

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.

Answer: E

QUESTION NO: 8

In case neither cron.allow nor cron.deny exist in /etc/, which of the following is true?

A. Without additional configuration, no users may have user specific crontabs.

B. Without additional configuration, all users may have user specific crontabs.

C. The cron daemon will refuse to start and report missing files in the system's logfile.

D. When a user creates a user specific crontab the system administrator must approve it explicitly.

Answer: A

QUESTION NO: 9

Which of the following commands can remove a user from a group?

A. grouprm

B. groupmod

C. passwd

D. usergroups

E. usermod

Answer: E

QUESTION NO: 10

Where are user specific crontabs stored?

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.

Answer: B

QUESTION NO: 11

Which file contains the date of the last change of a user's password?

A. /etc/gshadow

B. /etc/passwd

C. /etc/pwdlog

D. /etc/shadow

E. /var/log/shadow

Answer: D

QUESTION NO: 12

Which environment variable should be set in order to change the time zone for the commands run from within the environment variable's scope? (Specify the variable name only.)

Answer: TZ

QUESTION NO: 13

Each entry in a crontab must end with what character?

A. Tab

B. Space

C. Backslash

D. Newline

Answer: D

QUESTION NO: 14

To prevent a specific user from scheduling tasks with at, what should the administrator do?

A. Add the specific user to /etc/at.allow file.

B. Add the specific user to [deny] section in the /etc/atd.conf file.

C. Add the specific user to /etc/at.deny file.

D. Add the specific user to nojobs group.

E. Run the following: atd --deny [user].

Answer: C

QUESTION NO: 15

Which of the following crontab entries will execute myscript at 30 minutes past every hour on Sundays?

A. 0 * * * 30 myscript

B. 30 * * * 6 myscript

C. 30 0 * * 0 myscript

D. 30 0-23 * * 0 myscript

E. 0 0-23 * * 30 myscript

Answer: D

QUESTION NO: 16

Which of the following files assigns a user to its primary group?

A. /etc/pgroup

B. /etc/shadow

C. /etc/group

D. /etc/passwd

E. /etc/gshadow

Answer: D

QUESTION NO: 17

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)?

A. export LANGUAGE="pt"

B. export MESSAGE="pt"

C. export UI_MESSAGES="pt"

D. export LC_MESSAGES="pt"

E. export ALL_MESSAGES="pt"

Answer: D

QUESTION NO: 18

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.)

Answer: /etc/cron.allow

QUESTION NO: 19

Which commands can be used to change a user's account aging information? (Choose THREE correct answers.)

A. usermod

B. passwd

C. chattr

D. chage

E. chsh

Answer: A, B, D

QUESTION NO: 20

Which command is used to add an empty group to the system? (Specify ONLY the command without any path or parameters.)

Answer: groupadd, /usr/sbin/groupadd

QUESTION NO: 21

What is NOT contained in the locale setting of the operating system?

A. currency symbol

B. language

C. timezone

D. thousands separator

Answer: C

Site Search:

Close

Close
Download Free Demo of VCE
Exam Simulator

Experience Avanset VCE Exam Simulator for yourself.


Simply submit your e-mail address below to get started with our interactive software demo of your free trial.


Enter Your Email Address

Free Demo Limits: In the demo version you will be able to access only first 5 questions from exam.