Most daily Linux work eventually involves files and directories. Configuration, logs, source code, and downloads all live in the filesystem, so creating files and directories is the foundation for copying, moving, deleting, and editing.
Create files with touch
touch notes.txt creates an empty file in the current directory. If it exists, the command normally updates its timestamps without clearing it. touch is not a text editor. It can handle multiple targets, as in touch notes.txt todo.txt ideas.txt. Extensions are simply part of a filename and mainly communicate intent to people.
Create directories with mkdir
mkdir projects creates a directory and normally reports an error if it already exists. You can provide several targets at once, as in mkdir documents images backup.
touch notes.txt Create an empty file or update an existing file's timestamps.
mkdir projects Create one directory in the current location.
mkdir -p projects/linux/scripts Create a nested path together with missing parents.
mkdir "My Projects" Quote one name containing a space.
Nested paths and names with spaces
Creating projects/linux/scripts fails when intermediate directories are missing, while mkdir -p projects/linux/scripts creates the parents too. Because the shell splits arguments at spaces, mkdir My Projects creates two directories. Use mkdir "My Projects" or mkdir My\ Projects for one name.
Naming habit: Linux permits spaces, but lowercase names, hyphens, and underscores such as linux-notes and project_files are easier in commands and scripts. This is a convention, not a requirement.
Build a Release Package
Simulated terminal ready. Run commands and watch the filesystem on the right.
/homealicearchivebackupcachedataindex.bin
DocumentsDownloadsemptyPicturesprojectsrcREADME.md
.bashrc.profileaccess.logapp.logdraft.txterror.lognotes.txt
varlogsyslog
Quick buttons fill the prompt; run the command or press Enter to change terminal and filesystem state.KNOWLEDGE QUIZ
KNOWLEDGE QUIZ
Create a Website Skeleton
From an empty directory, use as few commands as practical to create website/assets/css, website/assets/js, and the files website/index.html, website/assets/css/main.css, and website/assets/js/app.js. Finish by checking with ls.
- Requirement 1: use mkdir -p for the nested directories.
- Requirement 2: create all three files with one touch command.