0
0
Linux CLIscripting~10 mins

touch (create empty files) in Linux CLI - Mini Project: Build & Apply

Choose your learning style9 modes available
Create Empty Files Using touch Command
📖 Scenario: You are organizing your project folder and need to create some empty files as placeholders for future content.
🎯 Goal: Learn how to create empty files using the touch command in Linux command line.
📋 What You'll Learn
Create empty files with exact names using the touch command
Use a variable to store a filename
Create multiple files in one command
Display the list of created files
💡 Why This Matters
🌍 Real World
Creating empty files is common when setting up projects or placeholders for future content.
💼 Career
Knowing how to quickly create and manage files using the command line is a basic skill for developers and system administrators.
Progress0 / 4 steps
1
Create a single empty file
Use the touch command to create an empty file named file1.txt.
Linux CLI
Need a hint?

The touch command creates an empty file if it does not exist.

2
Create a filename variable
Create a variable called filename and set it to file2.txt.
Linux CLI
Need a hint?

Use filename=file2.txt to assign the variable.

3
Create multiple empty files at once
Use the touch command to create three empty files named file3.txt, file4.txt, and file5.txt in one command.
Linux CLI
Need a hint?

You can list multiple filenames separated by spaces after touch.

4
Display the list of created files
Use the ls command to list all files starting with file in the current directory.
Linux CLI
Need a hint?

The ls file* command lists all files starting with 'file'. The order may vary.