Beginner 5 min
Files, folders, and the terminal
A terminal runs commands in a current working folder.
How it works
Imagine a folder tree with projects at the top and lessons inside it. From projects, cd lessons moves one step down the tree. With an absolute path, the starting point is part of the path. When a command cannot find a file, check the current folder before changing the command.
Walk through an example
cd changes the current folder. pwd displays it in shells that support that command. ls lists its entries in Unix-like shells.
What to watch for
A relative path starts from the current folder. Use quotes when a path contains spaces and check the location before changing files.
Check your understanding
Where does the shell look for lessons?
See the example and explanation
- Worked example
- Given
You are in projects and enter cd lessons. - Answer
Inside projects.
Without an absolute path, the shell interprets lessons relative to its current folder.