nerdexam
LPI

102-500 · Question #185

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. /etc/profile is a system-wide shell initialization script that executes when a user opens a login shell, setting environment variables like PATH, UMASK, and PS1 - making C correct. A is wrong because the login welcome message (MOTD) comes from /etc/motd, not /etc/profile. B is…

Shells and Shell Scripting

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

(33 responses)
  • A
    6% (2)
  • B
    15% (5)
  • C
    76% (25)
  • D
    3% (1)

Explanation

/etc/profile is a system-wide shell initialization script that executes when a user opens a login shell, setting environment variables like PATH, UMASK, and PS1 - making C correct.

  • A is wrong because the login welcome message (MOTD) comes from /etc/motd, not /etc/profile.
  • B is wrong because login access control is handled by files like /etc/security/access.conf or PAM configuration, not /etc/profile.
  • D is wrong because application defaults are typically stored in per-application config directories (e.g., /etc/skel/ or app-specific paths), not in /etc/profile.

Memory tip: Think of "profile" like a professional profile - it describes who you are (your environment) when you show up to work (log in). The /etc/ prefix signals it's system-wide, affecting all users.

Topics

#Shell Startup Files#Environment Variables#Login Shells#Shell Configuration

Community Discussion

No community discussion yet for this question.

Full 102-500 Practice