Practice & Assessment
Test your understanding of Linux Terminal Fundamentals
Multiple Choice Questions
5What is the difference between cd .. and cd ~ in the Linux terminal?
A developer runs grep error app.log but gets no results even though they can see the word Error in the file. What is the fix?
What does chmod 644 config.json do to the file permissions?
A developer adds a new binary to ~/.local/bin but the command is still not found. What is the most likely fix?
Which command finds the exact filesystem path of the node executable?
Coding Challenges
1Project Scaffolding Script
Write a Bash script called scaffold.sh that takes a project name as a command-line argument ($1). It must: (1) create a directory ~/projects/project-name, (2) inside it create src/, tests/, and docs/ subdirectories, (3) create src/index.js and README.md as empty files, (4) set README.md permissions to 644, (5) print the final directory tree using ls -R. If no argument is provided, print usage instructions and exit with code 1. Input: project name string. Output: created directory structure plus confirmation message. Time estimate: 20-25 minutes.
Mini Project
Developer Log Analyzer
Write a Bash script called analyze-log.sh that accepts a log file path as an argument. It must: (1) verify the file exists and is readable, exiting with a helpful error if not, (2) count and print total lines in the file, (3) use grep to extract and count lines containing ERROR, WARN, and INFO (case-insensitive), (4) print the 5 most recent lines using tail, (5) search for any IP address pattern using grep and print unique matches, (6) write a summary to a new file called original-name-report.txt with all findings. The script must use pipes, grep, environment variables for the output filename, and proper exit codes for error conditions.
