Script Valley
Linux Basics Complete Course: From Beginner to System Administrator
Module 3: File Management Commands/Assessment

Practice & Assessment

Test your understanding of Module 3: File Management Commands

Multiple Choice Questions

5
1

Which command creates a directory and all necessary parent directories without error?

2

Which command would you use to monitor a log file in real time as new entries are added?

3

What does the >> operator do in Linux?

4

Which grep flag makes a search case-insensitive?

5

What is the purpose of the pipe operator (|) in Linux?

Coding Challenges

1
1

Build a Project Directory Structure

Using a single mkdir -p command with brace expansion, create the following directory structure inside your home directory: myproject/src, myproject/tests, myproject/docs, myproject/logs. Then use touch to create a main.sh file inside src, a README.md inside myproject, and a server.log inside logs. Use echo with redirection to write the text 'Project initialized' into README.md. Finally, use grep to search for the word 'initialized' inside README.md and use ls -R myproject to display the full directory tree.

Easy
GeeksForGeeks

Mini Project

1

Log Analysis Pipeline

Create a directory called log-analysis in your home directory. Copy the system log file /var/log/syslog (or /var/log/messages on CentOS) into it. Using pipes and redirection, perform the following analysis: extract all lines containing the word 'error' (case-insensitive) and save them to errors.txt; count the total number of error lines and save the count to error-count.txt; extract the last 50 lines of the log and save them to recent.txt; use sort and uniq to find the top repeated words in the error lines and save the result to top-errors.txt. Write a brief summary of your findings into a file called analysis-summary.txt using echo and >>.

Medium