LPI 102-500 Practice Test 1
Question 1
On a production Linux workstation or server, a technician observes: A new analyst's PATH customization works in a terminal but disappears when an SSH login invokes a different startup path. Which administrative step is the MOST appropriate way to resolve this issue? Select ONE best answer.
- Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity.
- Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required.
- Check the immediately relevant command exit code and use && for success-dependent steps and || for failure fallback, grouping commands where precedence matters.
- Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired.
Explanation
Correct Answer
D:Recommended administrative action: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
Incorrect Answers
A:That option would assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity, but it addresses a different concern. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
B:This alternative addresses Sourcing shell settings and removing variables, not the specific issue of Bash login and interactive startup files: Use source or the dot command to evaluate trusted configuration in the current shell, and use unset to remove the variable or function definition when required. Linux principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file. Appropriate response: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. Root-cause evidence: Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions. Independent acceptance: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
C:That option would check the immediately relevant command exit code and use && for success-dependent steps and || for failure fallback, grouping commands where precedence matters, but it addresses a different concern. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
Question 2
During an LPIC-1 practice lab, the operator encounters this condition: A new analyst's PATH customization works in a terminal but disappears when an SSH login invokes a different startup path. Which Linux behavior or technical principle BEST explains why the issue occurs? Select ONE best answer.
- read -r avoids backslash escape processing, an empty IFS can preserve leading and trailing whitespace, and shell pipeline subshells may isolate assignments.
- Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
- Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity.
- Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
Explanation
Correct Answer
B:Relevant Linux operating principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
Incorrect Answers
A:This alternative addresses Reading input line by line and preserving backslashes, not the specific issue of Bash login and interactive startup files: read -r avoids backslash escape processing, an empty IFS can preserve leading and trailing whitespace, and shell pipeline subshells may isolate assignments. Linux principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file. Appropriate response: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. Root-cause evidence: Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions. Independent acceptance: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
C:That option would assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity, but it addresses a different concern. Independent acceptance: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
D:This alternative addresses Sourcing shell settings and removing variables, not the specific issue of Bash login and interactive startup files: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. Linux principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file. Appropriate response: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. Root-cause evidence: Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions. Independent acceptance: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
Question 3
A helpdesk escalation describes this Linux behavior: A new analyst's PATH customization works in a terminal but disappears when an SSH login invokes a different startup path. Which evidence or command result MOST directly tests the suspected root cause? Select ONE best answer.
- Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity.
- Run controlled success and failure commands, display or capture $?, inspect && and || order, and observe which branch actually executes.
- Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions.
- Feed literal backslashes and spaced lines through a test input, compare the resulting strings, and inspect whether a pipeline created a subshell.
Explanation
Correct Answer
C:Most direct verification evidence: Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
Incorrect Answers
A:This shortcut is unsafe for the present Linux issue: Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
B:That option would run controlled success and failure commands, display or capture $?, inspect && and || order, and observe which branch actually executes, but it addresses a different concern. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
D:This alternative addresses Reading input line by line and preserving backslashes, not the specific issue of Bash login and interactive startup files: Feed literal backslashes and spaced lines through a test input, compare the resulting strings, and inspect whether a pipeline created a subshell. Linux principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file. Appropriate response: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. Root-cause evidence: Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions. Independent acceptance: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
Question 4
An operations handoff identifies this problem: A new analyst's PATH customization works in a terminal but disappears when an SSH login invokes a different startup path. Which observed outcome BEST confirms a successful and properly scoped correction? Select ONE best answer.
- The success path executes only after a zero exit status and the failure notification executes only for intended errors.
- Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity.
- Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
- The intended trusted executable is resolved first and the correct variable reaches child programs without permitting an untrusted directory to shadow commands.
Explanation
Correct Answer
C:Observable acceptance criterion: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
Incorrect Answers
A:This alternative addresses Shell exit status and AND OR command lists, not the specific issue of Bash login and interactive startup files: The success path executes only after a zero exit status and the failure notification executes only for intended errors. Linux principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file. Appropriate response: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. Root-cause evidence: Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions. Independent acceptance: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
B:This shortcut is unsafe for the present Linux issue: Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
D:This alternative addresses Safe PATH changes and environment export, not the specific issue of Bash login and interactive startup files: The intended trusted executable is resolved first and the correct variable reaches child programs without permitting an untrusted directory to shadow commands. Linux principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file. Appropriate response: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. Root-cause evidence: Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions. Independent acceptance: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
Question 5
A team maintaining a Linux host reports: A new analyst's PATH customization works in a terminal but disappears when an SSH login invokes a different startup path. Which misleading assumption MOST directly contributes to this failure and should be rejected? Select ONE best answer.
- Assume every script ending in .sh is run by Bash automatically and that readable script files are always executable using ./script.sh.
- Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity.
- Use textual equality for every numeric comparison and rely on unquoted empty variables to supply a valid argument to test.
- Assume ordinary `read` always preserves backslashes and whitespace and that variables modified in any piped loop persist in the parent shell.
Explanation
Correct Answer
B:Reject this specific misconception: Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity. It incorrectly assumes behavior that conflicts with the observed Linux conditions.
Incorrect Answers
A:That option would assume every script ending in .sh is run by Bash automatically and that readable script files are always executable using ./script.sh, but it addresses a different concern. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
C:That option would use textual equality for every numeric comparison and rely on unquoted empty variables to supply a valid argument to test, but it addresses a different concern. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
D:That option would assume ordinary `read` always preserves backslashes and whitespace and that variables modified in any piped loop persist in the parent shell, but it addresses a different concern. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
Question 6
While verifying a Linux change request, an engineer finds: An interactive non-login Bash session lacks an alias added only to a user's .bash_profile and a shell opens without the expected shortcut. Which administrative step is the MOST appropriate way to resolve this issue? Select ONE best answer.
- Define and export or source an appropriate Bash function when reusable parameterized behavior is needed; use aliases for simple interactive substitutions and verify command lookup.
- Check the immediately relevant command exit code and use && for success-dependent steps and || for failure fallback, grouping commands where precedence matters.
- Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired.
- Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity.
Explanation
Correct Answer
C:Recommended administrative action: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. bash_profile and a shell opens without the expected shortcut.
Incorrect Answers
A:That option would define and export or source an appropriate Bash function when reusable parameterized behavior is needed; use aliases for simple interactive substitutions and verify command lookup, but it addresses a different concern. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
B:This alternative addresses Shell exit status and AND OR command lists, not the specific issue of Bash login and interactive startup files: Check the immediately relevant command exit code and use && for success-dependent steps and || for failure fallback, grouping commands where precedence matters. bash_profile and a shell opens without the expected shortcut.
D:This shortcut is unsafe for the present Linux issue: Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity. It cannot establish a safe correction. bash_profile and a shell opens without the expected shortcut.
Question 7
A Linux administrator investigates the following system incident: An interactive non-login Bash session lacks an alias added only to a user's .bash_profile and a shell opens without the expected shortcut. Which Linux behavior or technical principle BEST explains why the issue occurs? Select ONE best answer.
- Functions accept positional parameters and are shell constructs; aliases are mainly parsed in interactive shells and are not a reliable portable interface for executable scripts.
- Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
- Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed.
- Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity.
Explanation
Correct Answer
B:Relevant Linux operating principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file. bash_profile and a shell opens without the expected shortcut.
Incorrect Answers
A:This alternative addresses Bash functions versus aliases and command lookup, not the specific issue of Bash login and interactive startup files: Functions accept positional parameters and are shell constructs; aliases are mainly parsed in interactive shells and are not a reliable portable interface for executable scripts. bash_profile and a shell opens without the expected shortcut. Linux principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file. Appropriate response: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. Root-cause evidence: Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions. Independent acceptance: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
C:This alternative addresses Sourcing shell settings and removing variables, not the specific issue of Bash login and interactive startup files: Sourcing executes shell statements in the current process, whereas launching a new process isolates its environment; an empty variable still exists until removed. bash_profile and a shell opens without the expected shortcut. Linux principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file. Appropriate response: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. Root-cause evidence: Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions. Independent acceptance: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
D:This shortcut is unsafe for the present Linux issue: Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity. It cannot establish a safe correction. bash_profile and a shell opens without the expected shortcut. Linux principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
Question 8
On a production Linux workstation or server, a technician observes: An interactive non-login Bash session lacks an alias added only to a user's .bash_profile and a shell opens without the expected shortcut. Which evidence or command result MOST directly tests the suspected root cause? Select ONE best answer.
- Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity.
- Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions.
- Check substitution output, command return status, test expression operands and both empty and positive numeric cases.
- Inspect /etc/skel permissions and contents, review useradd home-creation settings, then create a controlled test account and compare its new home.
Explanation
Correct Answer
B:Most direct verification evidence: Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions. bash_profile and a shell opens without the expected shortcut.
Incorrect Answers
A:This shortcut is unsafe for the present Linux issue: Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity. It cannot establish a safe correction. bash_profile and a shell opens without the expected shortcut. Linux principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file. Appropriate response: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. Root-cause evidence: Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions. Independent acceptance: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
C:That option would check substitution output, command return status, test expression operands and both empty and positive numeric cases, but it addresses a different concern. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
D:That option would inspect /etc/skel permissions and contents, review useradd home-creation settings, then create a controlled test account and compare its new home, but it addresses a different concern. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
Question 9
During an LPIC-1 practice lab, the operator encounters this condition: An interactive non-login Bash session lacks an alias added only to a user's .bash_profile and a shell opens without the expected shortcut. Which observed outcome BEST confirms a successful and properly scoped correction? Select ONE best answer.
- The file runs under its specified interpreter for authorized users and fails safely for unauthorized execution without relying on a misidentified shell.
- The branch correctly distinguishes zero, positive and invalid input without running an unintended remediation step.
- Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
- Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity.
Explanation
Correct Answer
C:Observable acceptance criterion: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets. bash_profile and a shell opens without the expected shortcut.
Incorrect Answers
A:This alternative addresses Bash shebang and executable permission, not the specific issue of Bash login and interactive startup files: The file runs under its specified interpreter for authorized users and fails safely for unauthorized execution without relying on a misidentified shell. bash_profile and a shell opens without the expected shortcut. Linux principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file. Appropriate response: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. Root-cause evidence: Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions. Independent acceptance: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
B:This alternative addresses Command substitution tests and numeric conditions, not the specific issue of Bash login and interactive startup files: The branch correctly distinguishes zero, positive and invalid input without running an unintended remediation step. bash_profile and a shell opens without the expected shortcut. Linux principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file. Appropriate response: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. Root-cause evidence: Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions. Independent acceptance: Fresh shells of each intended type obtain the expected settings without introducing duplicate PATH entries or leaking secrets.
D:This shortcut is unsafe for the present Linux issue: Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
Question 10
A helpdesk escalation describes this Linux behavior: An interactive non-login Bash session lacks an alias added only to a user's .bash_profile and a shell opens without the expected shortcut. Which TWO complementary steps provide the best corrective action and its most direct diagnostic verification? Select TWO answers.
- Use IFS= read -r within an appropriately redirected loop to preserve literal input and design variable state without relying on a pipeline subshell.
- Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired.
- Inspect the first line, file mode, file type and any shell syntax errors, then execute in a controlled test account using the expected invocation.
- Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity.
- Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions.
Explanation
Correct Answers
B:Recommended administrative action: Put login-specific exports in the appropriate user login profile and interactive aliases in ~/.bashrc, sourcing the interactive configuration from the login profile when desired. bash_profile and a shell opens without the expected shortcut. Linux principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
E:Most direct verification evidence: Check the shell invocation mode, inspect /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile and ~/.bashrc, and compare command resolution in fresh login and non-login sessions. bash_profile and a shell opens without the expected shortcut. Linux principle: Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
Incorrect Answers
A:That option would use IFS= read -r within an appropriately redirected loop to preserve literal input and design variable state without relying on a pipeline subshell, but it addresses a different concern. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
C:That option would inspect the first line, file mode, file type and any shell syntax errors, then execute in a controlled test account using the expected invocation, but it addresses a different concern. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.
D:This shortcut is unsafe for the present Linux issue: Assume every Bash process automatically reads ~/.bashrc and ~/.bash_profile in the same order regardless of login and interactivity. bash_profile and a shell opens without the expected shortcut. Bash login and interactive non-login shells read different startup files; ~/.bashrc is typically for interactive non-login behavior, while login startup uses a preferred profile file.