Font size
WorksheetsLPIC 102-500 PRIMEIRA PARTE INGLES
Total questions: 41
Worksheet time: 21mins
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
result: 3 4 5 6 2 1
result: 1 2 3 4 5 6
result: 6 5 4
result: 6 5 4 3 2 1
result: 3 2 1
When the command echo $? outputs 1, which of the following statements is true?
It is the process ID of the echo command.
It is the process ID of the current shell.
It is the exit value of the command executed immediately before echo.
It is the exit value of the echo command.
Which command makes the shell variable named VARIABLE visible to subshells?
export $VARIABLE
export VARIABLE
set $VARIABLE
set VARIABLE
env VARIABLE
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.
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.)
/etc/skel
/home/default
/usr/share/skel
/etc/default
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
Which of the following commands puts the output of the command date into the shell variable mydate?
mydate="$(date)"
mydate="exec date"
mydate="$((date))"
mydate="date"
mydate="${date}"
Which of the following files, when existing, affect the behavior of the Bash shell?
~/.bashconf
~/.bashrc
~/.bashdefaults
~/.bash_etc
~/.bash_profile
What is the difference between the commands test -e path and test -f path?
They are equivalent options with the same behaviour.
The -f option tests for a regular file. The -e option tests for an empty file.
Both options check the existence of the path. The -f option also confirms that it is a regular file.
The -f option tests for a regular file. The -e option tests for an executable file.
How can the existing environment variable FOOBAR be suppressed for the execution of the script./myscript only?
unset -v FOOBAR;./myscript
set -a FOOBAR="";./myscript
env -u FOOBAR./myscript
env -i FOOBAR./myscript
When the command echo $$ outputs 12942, what is the meaning of 12942?
It is the process ID of the echo command.
It is the process ID of the current shell.
It is the process ID of the last command executed.
It is the process ID of the last command which has been placed in the background.
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
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?
CASE
FROM
WHERE
IF
Which of the following commands lists all defined variables and functions within Bash?
env
set
env -a
echo $ENV
Which of the following SQL queries counts the number of occurrences for each value of the field order_type in the table orders?
SELECT order_type,COUNT(*) FROM orders WHERE order_type=order_type;
SELECT order_type,COUNT(*) FROM orders GROUP BY order_type;
COUNT(SELECT order_type FROM orders);
SELECT COUNT(*) FROM orders ORDER BY order_type;
SELECT AUTO_COUNT FROM orders COUNT order_type;
What is the purpose of the file /etc/profile?
It contains the welcome message that is displayed after login.
It contains security profiles defining which users are allowed to log in.
It contains environment variables that are set when a user logs in.
It contains default application profiles for users that run an application for the first time.
What command displays all aliases defined in the current shell? (Specify the command without any path information)
alias, alias -p
ls -a
set
env
Which of the following are requirements in order to run a shell script like a regular command from anywhere in the filesystem?
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.
Which of the following SQL statements will select the fields name and address from the contacts table?
SELECT (name, address) FROM contacts;
SELECT (name address) FROM contacts;
SELECT name, address FROM contacts;
SELECT name address FROM contacts;
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)
/etc/skel
/etc/default
/etc/profile.d
/etc/login.defs
Which of the following configuration files should be modified to set default shell variables for all users?
/etc/bashrc
/etc/profile
~/.bash_profile
/etc/.bashrc
Which of the following is the best way to list all defined shell variables?
env
set
env -a
echo $ENV
Which command allows you to make a shell variable visible to subshells?
export $VARIABLE
export VARIABLE
set $VARIABLE
set VARIABLE
env VARIABLE
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?
LIMIT
FROM
WHERE
IF
What benefit does an alias in bash provide?
It provides faster lookups for commands in the system directory.
It creates a local copy of a file from another directory.
It hides what command you are running from others.
It allows a string to be substituted for the first word of a simple command.
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:
The script should be executed by the program at the specified file path (the shebang line specifies the interpreter).
The script is a comment and will not be executed.
The file path is irrelevant to the execution of the script.
The script can be executed by any program.
What keyword is missing from this code sample of a shell script? ____ i in *.txt; do echo $i done
for
loop
until
while
What word is missing from the following SQL statement? ________ count(*) from tablename;
select
where
group
order
Which file used by XDM specifies the default wallpaper?
/etc/X11/xdm/Xsetup
/etc/X11/xdm.conf
/etc/X11/xdm/Defaults
/etc/X11/defaults.conf
Which command can be used to investigate the properties for a particular window in X by clicking that window?
xwininfo
xkill
xprop
xset
The X11 configuration file xorg.conf is grouped into sections. How is the content of the section SectionName associated with that section?
It is placed in curly brackets as in Section SectionName { ... }.
It is placed between a line containing Section "SectionName" and a line containing EndSection.
It is placed between the tags
It is placed after the row [SectionName].
It is placed after an initial unindented Section "SectionName" and must be indented by exactly one tab character.
What is the purpose of a screen reader?
It reads text displayed on the screen to blind or visually impaired people.
It reads the parameters of the attached monitors and creates an appropriate X11 configuration.
It displays lines and markers to help people use speed reading techniques.
It manages and displays files that contain e-books.
How is a display manager started?
It is started by a user using the command startx.
It is started like any other system service by the init system.
It is started by inetd when a remote host connects to the X11 port.
It is started automatically when a X11 user logs in to the system console.
What is the default name of the configuration file for the Xorg X11 server? (Specify the file name only without any path.)
xorg.conf
x11.conf
xserver.conf
xorg.ini
Which of the following commands shows the current color depth of the X Server?
xcd
xcdepth
xwininfo
xcolordepth
cat /etc/X11
For accessibility assistance, which of the following programs is an on-screen keyboard?
xkb
atkb
GOK
xOSK
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.)
xdm
gdm
lightdm
kdm
Which of the following are tasks handled by a display manager like XDM or KDM?
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.
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?
xcd
xcdepth
xwininfo
xcolordepth
cat /etc/X11
Your senior administrator asked you to change the default background of his machine, which uses XDM. Which file would you edit to achieve this?
/etc/X11/xdm/Xsetup
/etc/X11/xdm.conf
/etc/X11/xdm/Defaults
/etc/X11/defaults.conf
What is the purpose of the Sticky Keys feature in X?
To assist users who have difficulty holding down multiple keys at once
To prevent repeated input of a single character if the key is held down
To ignore brief keystrokes according to a specified time limit
To repeat the input of a single character
