student@ubuntu:~$
shell 2/5 25 XP

Shell Environment

0%

Quick Reference

Shell configuration files:

File When sourced
.bash_profile Login shells (SSH, first terminal)
.bashrc Interactive non-login shells
.profile Login shells (sh-compatible)
.bash_logout When a login shell exits

Common customizations in .bashrc:

# Aliases
alias ll='ls -la'
alias gs='git status'

# PATH additions
export PATH="$HOME/bin:$PATH"

# Custom prompt
PS1='\u@\h:\w\$ '

Common Pitfalls

  • .bash_profile vs .bashrc – Put settings in .bashrc and source it from .bash_profile. Otherwise settings may not apply in all terminal types.
  • Missing export – Variables without export are invisible to child processes.
  • PATH order – Directories are searched left-to-right. Put your custom directories first to override system commands.
  • Syntax in assignments – No spaces around =. VAR = hello is wrong (runs VAR as a command). Use VAR=hello.

Unlocks

Complete this skill to see what it unlocks.