The shell always stands somewhere
Your files live in directories (the command-line word for folders), and directories live inside other directories, forming a tree. At any moment your shell is standing inside exactly one directory, called the working directory. Every command you run happens from there.
This matters immediately, because the same command does different things in different places. ls lists somewhere, and the delete command coming in unit 3 deletes somewhere. Knowing exactly where you stand is the difference between cleaning out a scratch directory and destroying real work, which is why locating yourself is the first reflex to build.
Two commands cover it:
| Command | Stands for | What it tells you |
|---|---|---|
pwd | print working directory | The full address of the directory you are standing in |
ls | list | The names of the things inside that directory |
The very top of the tree is a single directory written as /, called the root. Every absolute address starts from it, like /home/sam/notes.txt.
Moving the shell and confirming where it landed
cd (change directory, covered fully in unit 2) moves the shell, and pwd reports where it ended up. The example stands first at the root /, then at /tmp, a scratch directory every Linux system provides.
cd / pwd cd /tmp pwd
Output
/ /tmp
Each pwd prints the location as of that moment, which is why the two lines differ. pwd takes no arguments at all: it has nothing to configure, it simply reports the current location.
Listing what is here
ls with no arguments lists the working directory's contents, sorted alphabetically. To have something worth listing, the example below first builds a small directory containing three files. mkdir makes a directory and touch makes empty files, and both get a full lesson of their own in unit 2.
Building a directory, then listing it
The first three commands create a directory, step into it, and put three empty files inside. Only the final ls prints anything, and it reports those three names in alphabetical order.
mkdir demo cd demo touch apple.txt banana.txt cherry.txt ls
Output
apple.txt banana.txt cherry.txt
mkdir, cd, and touch all succeed silently, which is normal on the command line: a command that has nothing to report says nothing. Silence means it worked.
When you have lost track of your position in the filesystem, pwd is the command that shows the full address of the directory you are standing in. The name is a mnemonic for print working directory, and it prints an absolute address such as /home/sam/projects.
ls answers a different question. It shows what is inside the current directory but never says where that directory sits in the tree, so a bare ls listing looks identical whether you are in a scratch folder or in something important.
Here is the same build-then-list pattern with a second directory. mkdir fruits creates it, cd fruits steps inside so the new files land in the right place, touch creates both files in a single command because touch accepts as many names as you give it, and ls confirms the result.
mkdir fruits cd fruits touch kiwi.txt mango.txt ls
Output
kiwi.txt mango.txt
The order of those four commands is what makes it work. cd fruits has to come before the touch, because touch creates files in the working directory, so running it too early would scatter kiwi.txt and mango.txt into the parent directory instead.