![]() |
![]() |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Examples--Copying Files to a Remote System (ftp)In this example, the user kryten opens an ftp connection to the system pluto, and uses the put command to copy a file from his or her system to the /tmp directory on system pluto.
In this example, the same user kryten uses the mput command to copy a set of files from his or her home directory to pluto's /tmp directory. Note that kryten can accept or reject individual files in the set.
Remote Copying With rcpThe rcp command copies files or directories between a local and a remote system or between two remote systems. You can use this command from a remote system (after logging in with the rlogin command) or from the local system (without logging in to a remote system). With rcp, you can perform the following remote copy operations:
If you have the automounter running, you can perform these remote operations with the cp command. However, the range of cp is constrained to the virtual file system that is created by the automounter and to operations relative to a user's home directory. Because rcp performs the same operations without these constraints, this section describes only the rcp versions of these tasks. Security Considerations for Copy OperationsTo copy files or directories between systems, you must have permission to log in and copy files.
Specifying Source and TargetWith the rcp command in the C shell, you can specify source (the file or directory you want to copy) and target (the location into which you will copy the file or directory) with either absolute or abbreviated path names.
Absolute path names identify files or directories that are mounted on a particular system. In the previous example, the first absolute path name identifies a file (MyFile.txt) on the mars system. Abbreviated path names identify files or directories relative to a user's home directory, wherever it might reside. In the previous first example, the abbreviated path name identifies the same file, MyFile.txt, but uses "~" symbol to indicate the jones home directory: ~ = mars:/home/jones The examples on the second line demonstrate the user of absolute and abbreviated path names after a remote login. No difference is evident for the abbreviated path name. However, because the remote login operation mounted the jones home directory onto the local system (parallel to the local user's home directory), the absolute path name no longer requires the system name mars. For more information about how a remote login operation mounts another user's home directory, see What Happens After You Log In Remotely. The following table provides a sample of absolute and abbreviated path names that are recognized by the C shell. The sample uses the following terminology:
Table 39-4 Allowed Syntaxes for Directory and File Names
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||