Essential Linux Commands
In Linux, every piece of knowledge is stored as a file, and collections of files are organized into directories. This unified design makes Linux powerful and consistent: whether you are interacting with text documents, executables, or devices, the system treats them all as files. Mastering file and directory operations is the foundation of system administration.
Understand Files in Linux
- Everything is a file: In Linux, almost everything - text, programs, devices are represented as a file.
| File Type | Description |
|---|---|
| Regular files | Text, images, executables |
| Directories | Special files that act as containers |
| Symbolic links | Shortcuts pointing to other files |
| Special files | Devices (/dev/sda), sockets, pipes |
This “everything is a file” philosophy makes Linux powerful and consistent. Whether accessing a disk, a network socket, or a text document, the interaction feels the same.
Core File Commands
Essential commands for managing files and directories:
touch: Creates a new empty filecat: Reads the contents of filecp: Copies a file to another directorymv: Moves or renames a filerm: Deletes a filemkdir: Creates a new directoryrmdir: Removes an empty directory
File Paths and Navigation
- Absolute Path: Starts from the root directory (e.g.
/home/user/notebook/intro.txt) - Relative Path: Starts from the current directory (e.g.
../notebook/intro.txt) - Special Symbols:
.→ Current directory..→ Parent directory~→ Home directory
Understanding paths is crucial for scripting and automation.
Viewing & Editing Files
less: Opens a file for reading, page by pagenano/vim: Magical quills for editing filehead/tail: Reads the beginning or end of a file
Practical Exercises
# Create a directory and read a file
mkdir Notebook
cd Notebook
touch intro.txt
echo "Introduction to Linux" > intro.txt
cat intro.txt
# Copy and move files
cp intro.txt copy_intro.txt
mv copy_intro.txt ../
# Delete a file and directory
rm intro.txt
cd ..
rmdir NotebookHackers Quest - Mini Project
- Build a directory called
Spellbook - Inside, create 5 files (
spell1.txt…spell5.txt) - Write a unique “spell” (sentence) in each
- Copy one file to another directory
- Delete one file, then directory and reflect: “What happens when knowledge is lost?”
Hackers Notebook
Files and directories are the scrolls and libraries of Linux. Every command, every script, and every system operation begins with them. Mastering file management is the first step toward mastering the kingdom of Linux.

Updated on Dec 31, 2025