HP ARPA File Transfer Protocol User's Guide
> Chapter 4 Using FTPPerforming Directory Operations |
||||||||||||||||||||||||
|
Viewing the Remote Working DirectoryThe 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 DirectoryTo 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 ListingThe 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 testt 226 transfer complete Listing Directory Information to a Local FileYou can transfer remote directory information to a local file with the LS or DIR commands using the following form (assuming a remote host UNIX file system): ftp> DIR [remotedirectory/]filename localfileor, ftp> LS [remotedirectory/]filename localfileThe format of remotedirectory/filename is dependent on the remote system implementation. The filename part can contain metacharacters (wildcard characters) supported by the remote system. Some metacharacters supported by the HP 9000 are asterisk (*), and question mark (?). For example, to transfer a listing of all files in the working directory to your local file REMDIR, enter: ftp> DIR * REMDIRTo transfer the contents of the directory named ftest beginning with the letter R to local file REMDIR1, enter: ftp> LS ftest/R* REMDIR1 Changing DirectoriesTo change directories in the remote account you are using, enter the CD command as follows: ftp> CD remotedirectoryWhere remotedirectory is the directory you wish to access. ExampleThe following example shows a user logged in to an HP 9000 as "myname" who checks the current directory, changes directories, then checks the new current directory.ftp> PWD 251 "/users/myname" is the current working directory. ftp> CD test 200 CWD command okay. ftp> PWD 251 "/users/myname/test" is the current working directory. ftp> CD .. 200 CWD command okay. ftp> PWD 251 "/users/myname" is the current working directory.
|