Courseiva
Shells, Scripting and Data ManagementmediumMultiple SelectObjective-mapped

LPIC-1 Shells, Scripting and Data Management Practice Question

A sysadmin is tasked with configuring the shell environment for all users. Which three files are typically sourced by Bash during login? (Choose THREE)

⚠ Common exam trap

Test-takers frequently confuse the sourcing order for login shells versus non-login interactive shells, mistakenly selecting ~/.bashrc or /etc/bash.bashrc which are only for non-login shells.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

~/.bash_profile

During a login shell, Bash reads ~/.bash_profile (if it exists) to set user-specific environment variables and startup scripts. This file is sourced before ~/.profile and is the preferred file for login shell configurations, ensuring environment settings like PATH are applied.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ~/.bashrc

    Why it's wrong here

    Sourced for interactive non-login shells, not login shells.

  • /etc/bash.bashrc

    Why it's wrong here

    Typically sourced for interactive non-login shells, not login.

  • ~/.bash_profile

    Why this is correct

    One of the user-specific login files.

  • /etc/profile

    Why this is correct

    Sourced for all users during login.

  • ~/.profile

    Why this is correct

    Another user-specific login file, used if no .bash_profile exists.

About these practice questions

Courseiva writes every LPIC-1 question from scratch — 527 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LPIC-1 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-1 exam.