Commands and files

Navigate remote directories

Use PWD, CWD, and CDUP while keeping local and remote working directories distinct.

8 minute lesson

~~~

PWD asks the server for the current remote directory. CWD path changes that directory. CDUP moves to its parent.

Interactive clients often provide local commands too, such as lcd. Those are client features and do not travel over FTP.

When a relative path fails, inspect both the local and remote current directories before changing permissions or assuming the file disappeared.

The remote server interprets FTP paths:

C: PWD
S: 257 "/incoming" is the current directory
C: CWD reports/2026
S: 250 Directory changed
C: PWD
S: 257 "/incoming/reports/2026" is the current directory

The visible path can be a virtual filesystem path, not a host operating-system path. A server may confine the account to a root and hide everything above it.

Quote paths through the client correctly, but remember that shell quoting and FTP pathname syntax are different layers. A GUI may send the command for you; verbose output reveals the actual remote path.

A 550 after CWD can mean missing path, denied traversal, or a server policy. Confirm PWD, test each path segment, and inspect server logs before changing broad permissions.

Create two nested directories on a test server, navigate with relative and absolute paths, then prove the local working directory did not change.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →