Bird
0
0

Given the following .bash_profile content:

medium📝 Command Output Q13 of 15
Linux CLI - Environment and Configuration
Given the following .bash_profile content:
export PATH="$PATH:/custom/bin"
source ~/.bashrc

And .bashrc contains:
alias ll='ls -l'

What happens when you open a new terminal after login?
AThe alias ll is set but PATH does not include /custom/bin.
BThe PATH includes /custom/bin and alias ll is available.
CThe PATH is unchanged and alias ll is not available.
DOnly the PATH is updated; alias ll is not set.
Step-by-Step Solution
Solution:
  1. Step 1: Understand .bash_profile execution at login

    The .bash_profile runs once at login, setting PATH to include /custom/bin and then sourcing .bashrc.
  2. Step 2: Understand .bashrc execution on new terminals

    Since .bashrc is sourced by .bash_profile, the alias ll='ls -l' is set for the shell session.
  3. Final Answer:

    The PATH includes /custom/bin and alias ll is available. -> Option B
  4. Quick Check:

    .bash_profile sets PATH + sources .bashrc = alias set [OK]
Quick Trick: Sourcing .bashrc in .bash_profile applies aliases at login [OK]
Common Mistakes:
  • Assuming alias is not set without opening a new terminal
  • Thinking PATH changes only after logout/login
  • Ignoring that .bashrc is sourced inside .bash_profile

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes