Two commands cover most of your movement on a Linux server over SSH: cd (change directory) takes you somewhere, and pwd (print working directory) tells you where you ended up. If a command is failing because you're "in the wrong place," these two fix it faster than anything else.
Run pwd first whenever you're unsure. It prints the full absolute path of your current location, like /home/username/public_html. Then use cd to move.
The basics
The essential forms of cd:
cd foldername, moves into a subfolder of where you are now (relative path)cd /full/path/here, jumps straight to an absolute path from anywherecd .., moves up one level to the parent directorycd ../.., moves up two levelscdwith no argument, orcd ~, takes you back to your home directorycd -, jumps back to the previous directory you were in
Tab completion is your friend here. Type the first few letters of a folder name and hit Tab. If there's only one match, the shell fills it in. If there are several, hit Tab twice to list them. This also saves you from typos in long paths.
A typical sequence
pwd cd public_html ls cd wp-content/plugins pwd
That last pwd confirms you actually landed where you meant to, which matters once you start running commands that touch files, since a command like rm or a WordPress CLI operation runs against whatever directory you're currently in.
Relative vs absolute paths
A relative path is written from your current location: cd logs only works if a logs folder exists right where you are. An absolute path always starts with / and works no matter where you currently are: cd /home/username/logs gets you there from anywhere in the filesystem.
When you're not sure which to use, absolute paths are safer, especially in scripts or cron jobs, since they don't depend on the working directory the command happened to start in.
Where you land on shared and WordPress hosting
On shared and WordPress hosting, SSH access drops you into your account's home directory, and your site files live under public_html (or a subfolder of it, for addon domains). You're scoped to your own account: you can move freely within your home directory, but you don't have root access and can't cd into other customers' spaces or most system directories. On most hosting accounts, the rest of the server is something we manage for you, so you'll mainly be working inside your own home directory tree: public_html, logs, and wherever your application stores uploads or config.
Where you land on a VPS
A VPS is different: you get broader SSH access to the server, so cd can take you further across the filesystem, including system directories like /etc, /var, and /usr. That's the point of a VPS: more control, and more responsibility for what you change. With that access there's less of a permission wall stopping you from cd-ing into a directory you shouldn't be touching, so double-check pwd before running anything destructive, and be careful with commands that operate on "everything in the current directory."
A few habits worth building
- Run
pwdbefore any command that deletes, moves, or overwrites files in bulk. - Use
lsright aftercdto confirm the folder has what you expect before you act on it. - Favor absolute paths in scripts and cron jobs so they behave the same regardless of where they're triggered from.
- On a VPS, get in the habit of checking
pwdbefore running anything with elevated privileges, since a mistake there can affect the whole server, not just your account.
If you're on shared or WordPress hosting and can't cd into a directory you believe should be accessible, or you're seeing permission errors that don't match what you expect, open a ticket from Support in the portal. A real person can check the account's file ownership and permissions directly.