Site icon Exam4Training

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

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

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

Latest 102-500 Dumps Valid Version with 194 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Exit mobile version