HP ARPA File Transfer Protocol User's Guide (36957-90159)

30 Chapter4
Using FTP
Performing Directory Operations
Performing Directory Operations
With FTP, you can view the remote working directory, change remote directories, and view
or save a listing of the contents of remote directories.
Viewing the Remote Working Directory
The PWD command is used to list the name of the remote working directory. The content of
the information displayed by PWD is dependent on the remote system.
For example, a UNIX implementation could display:
ftp> PWD
251 “/users/myname” is the current working directory
Viewing the Contents of a Remote Directory
To list the contents of the remote working directory use the DIR command. The contents
displayed using the DIR command are dependent on the remote host directory listing
facilities.
In the sample below, the working directory is mytest. The first entry is a directory, the
remaining entries are files.
ftp> DIR
200 PORT command okay.
150 Opening data connection for /bin/ls -l (123.50.42.32,50895) (0 bytes).
total 33
drwxrwxrwx 1 myname guest 10 Feb 13 18:44 ftest
-rw-rw-rw- 1 myname guest 100 Feb 12 18:42 file1
-rw-rw-rw- 1 myname guest 100 Feb 12 18:42 file2
-rw-rw-rw- 1 myname guest 110 Feb 13 18:43 testt
226 Transfer complete
nnn bytes received in n.nn seconds (n.nn Kbytes/sec)
To list the contents of another directory, enter the DIR command followed by a valid remote
directory name:
ftp> DIR
remotedirectory
Simple directory Listing
The LS command provides a consistent display of directory contents for unlike computer
systems. One item per line is displayed. For example:
ftp> LS
200 PORT command okay.
150 Opening data connection for /bin/ls (123.50.42.32,50896) (0 bytes).
ftest
file1
file2