0
0
Linux CLIscripting~10 mins

cat (display file contents) in Linux CLI - Mini Project: Build & Apply

Choose your learning style9 modes available
Display File Contents Using cat Command
📖 Scenario: You are working on a Linux system and want to quickly see what is inside a text file. The cat command helps you display the contents of files right in the terminal.
🎯 Goal: Learn how to use the cat command to display the contents of a file named example.txt.
📋 What You'll Learn
Create a file named example.txt with specific content
Use the cat command to display the file contents
💡 Why This Matters
🌍 Real World
Viewing file contents quickly in the terminal is common when checking logs, configuration files, or any text data.
💼 Career
System administrators, developers, and anyone working with Linux servers use cat daily to inspect files.
Progress0 / 4 steps
1
Create the file example.txt
Create a file named example.txt with the exact content: Hello, this is a test file.
Linux CLI
Need a hint?

You can use echo "text" > filename to create a file with text.

2
Check the file exists
Use the ls command to list files and confirm example.txt exists.
Linux CLI
Need a hint?

Use ls example.txt to check the file.

3
Display the contents of example.txt
Use the cat command with example.txt to display its contents.
Linux CLI
Need a hint?

Type cat example.txt to see the file content.

4
View the output of the cat command
Run the script and observe the output. It should display exactly: Hello, this is a test file.
Linux CLI
Need a hint?

The last line printed should be the file content.