CompTIA Linux+ XK0-006 (V8) Practice Question

After you add the alias

alias gst='git status --short --branch'

to every developer's ~/.bashrc, the alias is available when a user opens a new GNOME Terminal window on the local desktop, but it is missing when the same user connects through SSH (Bash is the login shell on all accounts).

You want the alias to appear automatically as soon as an SSH session starts while still keeping the definition inside each user's existing ~/.bashrc file. Which single change satisfies these requirements?

  • Append if [ -f ~/.bashrc ]; then . ~/.bashrc; fi to each user's ~/.bash_profile so the file is sourced during SSH logins.

  • Restart the SSH daemon with the -i option to force interactive shells to load ~/.bashrc automatically.

  • Move the alias definition from ~/.bashrc to the system-wide /etc/profile file.

  • Rename every user's ~/.bashrc file to ~/.bash_profile and delete the original.

CompTIA Linux+ XK0-006 (V8)
System Management
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot