Hands-on exercises in command line navigation, file operations, and shell scripting
The command line is your window into the system. Learning to navigate efficiently is the foundation of all Linux skills.
You've SSH'd into a new server. Write the commands you would use to: find out who you are, where you are, what's in the current directory, and what operating system is running.
Creating, copying, moving, and deleting files are fundamental operations. Understanding these commands and their options is essential.
rm -rf is irreversible. Always double-check paths before executing. Consider using rm -i for interactive confirmation or trash-cli for recoverable deletion.
You need to backup the /etc/nginx directory to /backup/nginx-$(date +%Y%m%d), then create a symbolic link /backup/nginx-latest pointing to the new backup. Write the commands.
Linux permissions determine who can read, write, and execute files. Understanding the permission model is critical for security.
A web server needs to: allow the webserver user to read files in /var/www, allow developers (devgroup) to read and write, and prevent everyone else from accessing. What permissions and ownership would you set?
Linux treats everything as text. Mastering grep, sed, awk, and regular expressions unlocks powerful data manipulation capabilities.
Write a one-liner to: find all unique IP addresses in an Apache access log, count how many requests each made, sort by count descending, and show the top 10.
Understanding processes is essential for troubleshooting and system administration. Learn to monitor, control, and investigate running processes.
A web server is unresponsive. Write the commands to: find the web server process, check its resource usage, identify if it's stuck, and restart it gracefully (or forcefully if needed).
Shell scripts combine commands into reusable programs. Learn to write scripts that automate repetitive tasks and solve complex problems.
Write a bash script that: takes a directory as an argument, finds all files modified in the last 24 hours, backs them up to a dated archive, and logs the results. Include error handling.
You've mastered command line navigation, file operations, permissions, text processing, and shell scripting.