nerdexam
Linux_Foundation

LFCS · Question #7

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

The correct answer is C. It contains environment variables that are set when a user logs in. The /etc/profile file is a system-wide configuration script executed by login shells for all users, primarily used to set global environment variables and execute startup programs.

Submitted by stefanr· Apr 18, 2026Operation of Running Systems

Question

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

Options

  • AIt contains the welcome message that is displayed after login.
  • BIt contains security profiles defining which users are allowed to log in.
  • CIt contains environment variables that are set when a user logs in.
  • DIt contains default application profiles for users that run an application for the first time.

How the community answered

(32 responses)
  • A
    3% (1)
  • C
    91% (29)
  • D
    6% (2)

Why each option

The `/etc/profile` file is a system-wide configuration script executed by login shells for all users, primarily used to set global environment variables and execute startup programs.

AIt contains the welcome message that is displayed after login.

The welcome message displayed after login is typically stored in `/etc/motd` (Message Of The Day), not `/etc/profile`.

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

Security profiles and user login permissions are managed by system files like `/etc/passwd`, `/etc/shadow`, or PAM (Pluggable Authentication Modules) configurations, not `/etc/profile`.

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

/etc/profile is a global configuration file processed by login shells for all users on a Linux system. Its primary purpose is to define system-wide environment variables, default paths, and other configurations that apply to every user upon login.

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

Default application profiles for new users are usually handled by desktop environment settings or application-specific configurations, not a general shell profile like `/etc/profile`.

Concept tested: Purpose of `/etc/profile`

Source: https://www.gnu.org/software/bash/manual/bash.html#Bash-Startup-Files

Topics

#/etc/profile#Environment variables#Login shell#System configuration

Community Discussion

No community discussion yet for this question.

Full LFCS Practice