Wildcards & Multi-File Operations
Concept & Overview
Imagine you have a stack of folders labeled "log_monday", "log_tuesday", and "log_wednesday", and you want to open and read all of them at once without typing every name out. Linux lets you use wildcards as search shortcuts!
- The * symbol matches any characters of any length. E.g., cat log_* reads every file that starts with "log_".
- The ? symbol acts as a single-character placeholder. E.g., log_?.txt matches log_1.txt but will ignore log_12.txt.
log_ in your home directory into a single file named combined.log using the * wildcard and > redirection.Command Syntax Reference
| Command / Syntax | Description |
|---|---|
cat log_* > combined.log | Combine all matching files into combined.log |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Use cat with wildcard pattern (log_*)
- ○Create "combined.log" in home directory
- ○Verify it has logs from log_1, log_2, and log_3
Ready to complete Quest 20?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.