SCA_SLES15 practice question 13 of 15
What should you do if you want to define alias commands so that each time you open a terminal window those aliases are available from the command prompt?
Full set: 69 questionsTo make shell aliases persistent, they must be defined in a shell startup file. For the bash shell, this is typically ~/.bashrc. A common and organized practice is to create a separate file, such as ~/.alias, containing the alias definitions. This file must then be "sourced" from within ~/.bashrc (e.g., by adding the line . ~/.alias). This ensures the aliases are loaded every time a new interactive shell is started.
B. This is incorrect; aliases can be made persistent by adding them to shell startup configuration files.
C. This command would append currently defined aliases to ~/.bashrc, but it is not the standard method for defining new, persistent aliases.
D. /etc/.history is not a standard directory, and history files track commands executed, not configuration settings like aliases.
E. The alias command does not have a --keep parameter for making aliases persistent.
- SUSE Linux Enterprise Server 15 SP4 Administration Guide, Chapter 1, Section 1.4, "Important Files". It identifies ~/.bashrc as the "user's individual configuration file for the Bash" where aliases and functions are defined.
- bash(1) man page, section "FILES". It describes ~/.bashrc as the "individual per-interactive-shell startup file."
Keep practicing
Take the free SCA_SLES15 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other SCA_SLES15 practice questions
- Question 1Which option for zypper will list the available patches?
- Question 2Which Vim command will save the current file without exiting?
- Question 3Which file should be edited to make sure a file system is mounted each time a system boot…
- Question 4You have just added a new directory to be exported via NFS. what command should you run n…
- Question 5If you have a service named tftp, which command and options would enable tftp to start au…
- Question 6Which statements about log file rotation are true? (Choose two)
