Module 1 · First steps in the terminal
clear, exit, reboot and what a reload means in TempMV
Tidying the screen, leaving a shell, restarting the machine, and the honest truth about this practice VM: it lives in your browser's memory, and a reload gives you a brand-new one.
What you will learn
- Clear the screen and understand what `exit` does to a shell.
- Reboot or power off the machine and know what survives.
- Explain why the lab filesystem resets and what TempMV does keep.
Three small commands close out the module, and they are a good excuse to be precise about what this machine is. clear wipes the screen. exit ends the shell. reboot restarts the computer. On the practice VM, each of these does slightly less — or slightly more — than you might expect.
clear
clear erases everything on the terminal and puts the prompt at the top. Nothing else changes: files, history and your working directory are untouched. It is purely cosmetic, and it is the right move whenever a wall of output makes you lose your place. Ctrl-L does the same without leaving the line you were typing.
exit
exit ends the current shell. On a desktop, that closes the terminal window; over a remote connection, it logs you out. On this machine the shell on the console is started by init, the first process, with the instruction to respawn it — so when you exit, a fresh shell appears a moment later with a new prompt. You cannot really leave, and nothing is lost by trying. Ctrl-D on an empty line is the same as exit: it sends "end of input", and a shell with no more input to read quits.
~% cd /tmp
tmp% exit
~% pwd
/root
Notice the prompt after the respawn: back to ~%. The new shell starts from scratch — home directory, empty history in memory, default settings. Anything you had set up in the old shell (lesson 69 will introduce variables and aliases) is gone. Files on disk are not affected.
reboot and poweroff
reboot asks init to shut everything down cleanly and start the kernel again; poweroff does the same and then stops. On a real server, files written to disk survive a reboot — that is what disks are for — and only running programs and unsaved work are lost. On a laptop you would be asked for a password first. Here, as root, both commands run immediately, and the next section explains why their effect is bigger than usual.
What this machine really is
The Linux Lab is a complete PC emulated inside your browser tab. The whole operating system — kernel, BusyBox, every directory you have seen — is loaded from a 7 MB image into memory when the page opens. There is no disk. The root filesystem is a RAM disk: writes go to memory and nowhere else. Consequences, stated plainly:
rebootandpoweroffdiscard every file you created. The machine comes back exactly as the image was built.- Reloading the page, closing the tab, or navigating away does the same, with no warning and no undo.
- Your course progress — completed lessons, quiz scores, passed tasks — is stored by the website in your browser, not in the VM. It survives reloads.
- Every practice task stages its own files under
/root/labwhen you open it, so a fresh machine is never a problem: open the task, and the scenario is rebuilt.
That closes the first module. You can read a prompt, find out where you are, look around, move, ask any command for help, and type quickly. Module 2 turns to the verbs: making, copying, moving and deleting the things you have so far only looked at.
Commands in this lesson
| Command | What it does |
|---|---|
clear | Erase the screen; nothing else changes. |
exit | End the current shell (here, a new one respawns). |
Ctrl-D | End of input: same as `exit` on an empty line. |
reboot | Restart the machine; here, from a clean image. |
poweroff | Shut the machine down. |
Quiz
What does `clear` change besides the screen?
- Nothing
- It empties the history
- It returns you to your home directory
On the practice machine you type `exit`. What happens?
- The machine powers off
- A new shell is started by `init` and you get a fresh prompt
- The browser tab closes
After `reboot`, what happens to files you created in `/root`?
- They are kept, as on any computer
- They are gone; the root filesystem lives in RAM
- They are moved to `/tmp`
What does survive a page reload?
- Files under `/root/lab`
- Your course progress, stored by the website in the browser
- The shell history inside the VM
Which keystroke is equivalent to typing `exit` on an empty line?
- Ctrl-C
- Ctrl-D
- Ctrl-L
Practice
Clear the terminal screen.
Create the empty file /root/lab/l10/temporary.txt and check the task. Later, if you like, reload the page and run `ls /root/lab/l10` to see for yourself that it is gone.
Which command restarts the machine cleanly? Type it in the answer box (you may also run it in the VM, knowing what you will lose).
Open this lesson in the app to do the tasks in a real Linux machine and have them checked.