Mission 3 of 5
Creating and Inspecting Files
Create a predictable project structure and inspect what Linux recorded.
Create empty files, inspect timestamps, and ask Linux what type a file really is.
Mental model
Understand what is happening
File extensions are helpful hints, but Linux can inspect real content.
Timestamps include access, modification, and metadata change times.
Guided lab
Work through the mission
Create files
Creates empty files and demonstrates brace expansion.
cd ~/linux-practice
touch myfile.txt
touch file_{1..5}.txt
ls -lCreate and remove empty directories safely
mkdir -p creates missing parent folders without failing when they already exist. rmdir removes only an empty directory, making it a safer first removal command than rm -r.
cd ~/linux-practice
mkdir -p files/{inbox,archive}
ls -ld files files/inbox files/archive
rmdir files/archiveInspect file metadata
Shows size, permissions, owner, timestamps, and inode.
stat myfile.txtIdentify file type
Compares a text file with a real executable.
echo 'Hello Ubuntu' > myfile.txt
file myfile.txt
file /bin/bashCheckpoint
Verify the mission
The expected files and directories appear in a long listing.
Try it yourself
One step without a recipe
Create a file called notes.txt. Create files/inbox with mkdir -p, then remove one empty practice directory with rmdir. Use stat and file on notes.txt.
Need a hint?
When someone tells you 'it's a text file,' run `file` on it anyway. Extensions lie all the time. A file called report.pdf could be an image renamed badly. The `file` command reads the actual bytes and tells you the truth.
Explain it back
Before you move on
- Which command shows file metadata?
- Why is file more reliable than only checking the extension?