Linux Command Line Mastery
Introduction
This document contains a comprehensive set of questions and projects to help you master the Linux command line.
Starting from basic concepts, you'll advance to expert-level tasks through practical exercises.
1. Basic Level Questions and Tasks
Questions:
1. How can you find the current working directory?
2. Which command lists files in a directory? How can you include hidden files?
3. What commands can you use to view the contents of a file? What are the differences?
Tasks:
- Create a directory named 'project' and add a file named 'notes.txt'. Copy it to another directory.
- Use `ls -la` to inspect file permissions.
2. Intermediate Level Questions and Tasks
Questions:
1. How do you count the occurrences of a word in a file?
2. How can you concatenate multiple files into one?
3. How do you check disk usage on the system?
Tasks:
- Create a script that logs the current date and time every hour.
- Back up `.txt` files in a directory by compressing them and moving them to a backup location.
3. Advanced Level Questions and Tasks
Questions:
Linux Command Line Mastery
1. How can you sort files by name or size in a directory?
2. How do you pause and resume a process?
3. How do you securely transfer a file between systems using SSH?
Tasks:
- Write a script to analyze log files and save frequent errors to a separate file.
- Set up a systemd service for a custom Python or Bash script.
4. Expert Level Questions and Tasks
Questions:
1. How can you analyze network traffic using Linux tools?
2. What are `awk` and `sed`, and how are they different?
3. How do you modify file permissions using `chmod` for advanced scenarios?
Tasks:
- Create a disk cleaning script to archive and delete files older than 30 days.
- Use `iptables` or `ufw` to block and unblock specific ports on the system.
5. Comprehensive Projects
- Build a command-line table creator that accepts user input and saves it as a text file.
- Develop a real-time system monitoring dashboard using Bash and tools like `gnuplot`.
- Write a script to automate file backups with email notifications on success or failure.
- Analyze system log files to generate a timeline of key events.
Advanced Expert-Level Questions
1. How can you redirect logs from a specific service to a custom log file?
Linux Command Line Mastery
2. What is the difference between hard links and symbolic links? Provide examples.
3. How do you write a script to monitor a directory and trigger an alert on any changes?
4. How can you use `rsync` to synchronize files between two remote servers?
5. Write a Bash script to automate the installation of essential tools on a new Linux system.