Mission 4 of 5
Customizing Your Shell Safely
Try a shell customization with a tested rollback path.
Experiment with aliases, prompt changes, and sourced files inside the sandbox before touching .bashrc.
Mental model
Understand what is happening
.bashrc runs for interactive Bash shells.
Temporary PS1 changes vanish when you close the shell or source defaults.
Practice customization in ~/linux-practice first.
Guided lab
Work through the mission
Inspect, do not edit
Reads the beginning of your real .bashrc without changing it.
cat ~/.bashrc | head -30Temporary prompt
Changes and restores the prompt only in the current shell.
OLD_PS1=$PS1
PS1='Practice> '
echo 'Prompt changed for this session'
PS1=$OLD_PS1Practice alias file
Sources aliases from a removable practice file.
echo "alias showdate='date +%Y-%m-%d'" >> ~/linux-practice/my_aliases
source ~/linux-practice/my_aliases
showdate
unalias showdateReal .bashrc edit example
This permanently modifies your real shell startup file. Explanation only in this course.
echo "alias la='ls -A'" >> ~/.bashrcCheckpoint
Verify the mission
The customization works and the original state can be restored.
Try it yourself
One step without a recipe
Create a practice alias file with one alias and source it. Remove the alias with unalias.
Need a hint?
Test every shell change in your current session before putting it in .bashrc. Change PS1 live. Add an alias with `alias`. If it breaks something, close the terminal and start fresh. Permanent config deserves a probation period.
Explain it back
Before you move on
- Why use ~/linux-practice/my_aliases first?
- What does source do?