Files

A file is a named unit of data kept in storage, and a directory (also called a folder) is a container that groups files and other directories together, which is how an entire computer's storage — the same storage introduced in the previous topic as the place that keeps saved programs and files after shutdown — stays organized instead of becoming one enormous unsorted pile. Directories nest inside other directories, forming a tree that starts from a single root directory, written as `/` on Linux systems like Ubuntu: a user's personal files typically live under `/home/username`, often shown as a shortcut called the home directory and written as `~`, with further directories underneath it like Documents or Desktop holding the user's actual files. A path is simply the route through that tree to a specific file or directory, and it comes in two forms: an absolute path always starts from the root and spells out the complete route, like `/home/username/Documents/notes.txt`, so it works correctly no matter where a command happens to be run from, while a relative path starts from wherever the user currently is, like `Documents/notes.txt`, which is shorter to type but only resolves correctly from the right starting location. The terminal is a text-based way to give the operating system instructions directly, standing in contrast to clicking through a graphical file manager: it is itself an application, exactly the kind the previous topic described the operating system loading into memory and scheduling on the CPU, except the specific job this application does is read a typed line of text, called a command, and hand it to the shell, the program that actually interprets and runs it. A small set of core commands covers most day-to-day navigation and file management: `pwd` prints the current directory's absolute path, so the user always knows exactly where they are; `ls` lists the files and directories inside the current location; `cd` changes the current directory, accepting either an absolute or a relative path; `mkdir` creates a new directory; `cp` copies a file or directory to a new location; `mv` moves or renames a file or directory; and `rm` removes a file, permanently, which is why it deserves particular caution before being run. Running any one of these commands is not fundamentally different from running any other program: the shell parses the typed text, locates the actual program that command refers to, and the operating system loads and executes it exactly the way the previous topic described a browser being loaded, scheduled on the CPU, and run — `ls` is simply a small, fast program whose entire job is to read a directory's contents and print them back to the terminal, built from the same fetch-decode-execute cycle underneath every other program on the machine.

A command is typed into the terminal
for example: ls Documents
The shell parses the text
identifies the command name and its arguments
The operating system locates and loads the program
the same loading process behind any application
The CPU executes it
fetch, decode, execute, same as any other program
The result prints back to the terminal
here: the contents of the Documents directory
The Filesystem Is a Tree, Starting at / A path is just the route from one point in the tree to another / bin home etc username (~) Documents Desktop absolute: /home/username/Documents — relative, from ~: Documents
Seven Commands Cover Most Daily Work Each one is just a small program the shell runs pwd — print the current directory's absolute path ls — list what's inside the current directory cd — change the current directory mkdir — create a new directory cp — copy a file or directory to a new location mv — move or rename a file or directory rm — remove a file, permanently

Take files further

Ask the copilot about this term, or have our engineers assess it against your process.