Creating Empty Files
Concept & Overview
Imagine wanting to start writing a new journal entry, but first you need a blank piece of paper. In Linux, we grab a fresh, empty text file using the touch command.
- The touch command creates a brand new, empty file if it doesn't exist yet (like running touch draft.txt to create draft.txt). If the file already exists, it simply updates the file's "last modified" timestamp without changing its contents. Let's put a file in our new projects folder.
task.txt inside the projects folder (either enter the folder first or use touch projects/task.txt).Command Syntax Reference
| Command / Syntax | Description |
|---|---|
cd projects | Enter the projects folder |
touch task.txt | Create file task.txt |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Use the "touch" command
- ○Create file "task.txt" inside "projects"
Ready to complete Quest 12?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.