Practice & Assessment
Test your understanding of Shell Configuration and Productivity
Multiple Choice Questions
5A developer edits ~/.bashrc and adds a new alias, but the alias is not available in the current terminal. What do they need to run?
What is the correct syntax for a shell alias that includes a flag?
In tmux, what does pressing Ctrl+B followed by d do?
What keyboard shortcut re-runs the last command with sudo prepended?
What is the difference between HISTSIZE and HISTFILESIZE in shell configuration?
Coding Challenges
1Personal Shell Profile Setup
Create a setup-shell.sh script that configures a developer shell environment by: (1) appending a block of useful aliases (ll, gs for git status, gp for git push, mkcd function) to ~/.bashrc only if they are not already present (check with grep for idempotency), (2) setting HISTSIZE=10000 and HISTFILESIZE=20000 if not already set, (3) printing a summary of what was added vs skipped. Input: none. Output: console summary and updated ~/.bashrc. Time estimate: 20-25 minutes.
Mini Project
Dotfiles Manager
Build a dotfiles management system using shell scripts. Create three files: (1) dotfiles/bashrc-extras containing at least 8 aliases, 3 exported environment variables, one custom function, and history settings, (2) dotfiles/install.sh which checks if each config block already exists in ~/.bashrc before appending, prints a bold status line for each item (ADDED, SKIPPED, FAILED), and sets permissions to 644 on all dotfiles, (3) dotfiles/uninstall.sh which removes the blocks added by install.sh using a unique comment marker. Test the full install, uninstall, and re-install cycle. The project demonstrates aliases, functions, environment variables, file permissions, grep-based idempotency checks, and .bashrc sourcing.
