Navigate and change virtual state
Use the current directory, paths and small reversible changes inside the safe simulator.
- Use observation before modification.
- Create a directory and file, then verify the changed virtual state.
- Terminal
- Command
- File
- Folder
On this page
The safe command loop
Use the same loop whenever you meet a new command:
- Read the command name and arguments.
- Predict what it should observe or change.
- Run it in the intended location.
- Read the output.
- Verify the resulting state with another observation.
Current directory and relative path
The shell keeps a current directory. pwd prints it in this Linux-style exercise. ls lists names inside it. cd lab changes the current directory to a child named lab.
The command touch note.txt uses a relative path. It creates the file inside whichever directory is current at that moment.
Try the complete loop
What happened
mkdir lab changed virtual state by creating a directory. cd lab changed the shell's current location. touch note.txt created a file there. The final ls verified the result instead of assuming success.
Common mistakes
- Reading output but not checking the resulting state.
- Forgetting that a relative path depends on the current directory.
- Treating
clearas deletion; it clears the screen, not files or command history.
Mini challenge
Reset the practice. Create a directory named evidence, enter it and create first.txt. Predict the final path before running pwd.
You can now issue and verify a command; next you will use that skill to inspect how computers connect.
Recommended next topic
Network foundations →
Why this comes nextInterfaces, addresses, packets, routes, transport ports and client/server roles.