LPI 102-500 Exam Questions
LPIC-1 Exam 102, Part 2 of 2, version 5.0 (Page 5 )

Updated On: 21-Feb-2026

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

  1. It contains the welcome message that is displayed after login.
  2. It contains security profiles defining which users are allowed to log in.
  3. It contains environment variables that are set when a user logs in.
  4. It contains default application profiles for users that run an application for the first time.

Answer(s): C

Explanation:

The file /etc/profile is a configuration file that is read by the Bash shell when a user logs in. It contains commands and settings that apply to all users of the system, such as environment variables, PATH information, terminal settings, and security commands. Environment variables are variables that affect the behavior of programs and processes. For example, the PATH variable defines the directories where the shell looks for executable files, and the JAVA_HOME variable defines the location of the Java installation. The /etc/profile file can also source other files from the /etc/profile.d/ directory, which can contain additional scripts for setting environment variables or other system-wide settings. The /etc/profile file is not the only file that can set environment variables for a user. There are also user-specific files, such as ~/.profile, ~/.bash_profile, and ~/.bashrc, that are read by the shell after /etc/profile. These files can override or append to the settings in /etc/profile, or define new variables for the user. The order and precedence of these files depend on the type of shell (login or interactive) and the options used to start the shell. You can learn more about the difference between these files here1 and here2.


Reference:

https://www.thegeekdiary.com/understanding-etc-profile-configuration-file-in-linux/

https://unix.stackexchange.com/questions/704610/what-does-the-etc-profile-do



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

  1. alias, alias -p

Answer(s): A

Explanation:

The alias command is used to create, list, or remove aliases in the current shell. An alias is a short name that refers to another command, usually with some options or arguments. Aliases are useful for saving typing time, avoiding spelling errors, or customizing the behavior of commands. To list all the aliases defined in the current shell, we can use the alias command without any arguments. This will print the aliases in the format of alias name='command'123. For example:
$ alias alias cp=`cp -i' alias l=`ls -CF' alias la=`ls -A' alias ll=`ls -alF' alias mv=`mv -i' alias rm=`rm -i' The output shows that some common commands, such as cp, mv, and rm, have aliases that add the - i option, which prompts the user before overwriting or deleting files. The l, la, and ll aliases are shortcuts for different variations of the ls command, which lists files and directories123.


Reference:

1: List All Available Commands and Aliases in Linux - Baeldung
2: get all aliases in linux shell - Stack Overflow
3: How to list all aliases on Linux - Linux Tutorials - Learn Linux Configuration



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

  1. The user issuing the command must be in the group script.
  2. The script file must be found in the $PATH.
  3. The script file must have the executable permission bit set.
  4. The script must begin with a shebang-line (#!) that points to the correct interpreter.
  5. The file system on which the script resides must be mounted with the option scripts.

Answer(s): B,C,D

Explanation:

In order to run a shell script like a regular command from anywhere in the filesystem, the following requirements must be met:
The script file must be found in the $PATH. The $PATH is a variable that contains a list of directories where the shell looks for executable files when a command is issued. If the script file is not in one of these directories, the shell will not be able to find it unless the full path is specified. The script file must have the executable permission bit set. This is a file attribute that determines whether the file can be executed by the user, the group, or others. The executable permission bit can be set using the chmod command, for example: chmod +x script.sh. The script must begin with a shebang-line (#!) that points to the correct interpreter. This is a special line at the beginning of the script that tells the shell which program to use to run the script, such as #!/bin/bash for bash scripts, or #!/usr/bin/perl for perl scripts. The shebang-line must match the exact path of the interpreter, otherwise the script will not run. The other options are not requirements for running a shell script like a regular command. There is no such group as script, and the file system mount option scripts does not exist.


Reference:

[LPI Linux Essentials - Topic 105: Shells, Scripting and Data Management] [LPI Linux Professional - Exam 102 Objectives - Topic 105: Shells and Shell Scripting]



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

  1. SELECT (name, address) FROM contacts;
  2. SELECT (name address) FROM contacts;
  3. SELECT name, address FROM contacts;
  4. SELECT name address FROM contacts;

Answer(s): C

Explanation:

The correct syntax for selecting specific columns from a table in SQL is to use the SELECT keyword followed by a comma-separated list of column names and then the FROM keyword followed by the table name. Therefore, the only option that follows this syntax is C. SELECT name, address FROM contacts; The other options are incorrect because they either use parentheses around the column names, which are not needed, or they omit the comma between the column names, which causes a syntax error.


Reference:

https://www.sqltutorial.org/sql-select/

https://www.w3schools.com/mysql/mysql_select.asp



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)

  1. /etc/skel,
    /etc/skel/

Answer(s): A

Explanation:

The /etc/skel directory is used to keep a sample copy of files and directories for when a new user has a home directory created. The /etc/skel directory contains files and directories that are automatically copied over to a new user's home directory when such user is created by the useradd or adduser command. The /etc/skel directory allows the system administrator to create a standard environment for all new users on the system. For example, the /etc/skel directory may contain a default .bashrc file that sets some aliases and environment variables for the new user, or a default .profile file that executes some commands at login. The /etc/skel directory may also contain subdirectories such as .ssh or .config that store configuration files for various applications or services. The name /etc/skel comes from the word "skeleton", as it provides a basic structure for the new user's home directory.


Reference:

[Linux User Administration]
[Linux Directory Structure]






Post your Comments and Discuss LPI 102-500 exam dumps with other Community members:

Join the 102-500 Discussion