Lesson 1 of 12 · Finding your way
The prompt, and where you are
Every mistake beginners make on a server starts with running the right command in the wrong directory.
Your prompt tells you four things: who you are, which machine you're on, where you are, and whether you're root. In andy@server:~$ the part before the @ is your username, the part after it is the hostname, the ~ is your current directory, and the $ means you are an ordinary user. If that last character is a #, you are root and every command is unguarded.
Linux has one filesystem tree starting at / (root). There are no drive letters. A path starting with / is absolute — it means the same thing from anywhere. A path not starting with / is relative to where you currently are. Two dots (..) mean the directory above; one dot (.) means here; ~ is shorthand for your home directory, /home/andy.
| pwd | print working directory — where am I? |
| ls | list what's in this directory |
| cd /etc | change to an absolute path |
| cd .. | go up one level |
| cd | go home (same as cd ~) |
Run these
Simulated Ubuntu 26.04.1 LTS (resolute) — nothing here can break.
Type help for the command list.
Check yourself
You see andy@server:/var/log# — what does the # tell you?
You're in /home/andy and type cd nginx. What happens?