Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Linux uucp command

Linux uucp command

Linux Command Reference Linux Command Reference

Linux uucp(Unix-to-Unix Copy) is a command used on Unix and Linux systems to transfer files between computers.

Although most file transfer tasks today are handled by more modern protocols (such as FTP, SCP, rsync, etc.), uucp it still has its uses in certain specific scenarios.

UUCP is a protocol for linking Unix systems over serial lines; using the UUCP protocol, its main function is to transfer files.

How the uucp command works

uucpThe command manages file transfers through theuucicodaemon. When a user executes theuucpcommand, the system adds the transfer job to a queue, and theuucicodaemon handles the actual transfer.uucicoIt tries to connect to the target system and, once connected, starts transferring files.

Syntax

uucp [选项] 源文件 目标文件

uucpThe command supports many options; here are some commonly used ones:

Complete parameter description:


Example

Transferring a single file

Suppose we have a file example.txt, and we want to transfer it from the local system to the remote system's /home/user/ directory on the remote host, you can use the following command:



uucp example.txt remote!/home/user/example.txt

In this command,remote! represents the name of the remote system,/home/user/example.txt is the destination path.

Transferring an entire directory

If we want to transfer a directory and all its contents, we can use -r Option:



uucp -r mydir remote!/home/user/mydir

This will recursively copy the mydir directory and all its subdirectories and files to the remote system's /home/user/mydir directory.

Overwriting the destination file

If a file with the same name already exists at the destination, we can use the -f option to overwrite it:



uucp -f example.txt remote!/home/user/example.txt

Displaying the job ID

If we want to view the job ID of a transfer task, we can use -j Option:



uucp -j example.txt remote!/home/user/example.txt

After running this command, the system returns a job ID, which we can use to query the transfer status.


Limitations of the uucp command

Although uucp The command is still useful in some scenarios, but it also has some limitations:

Linux Command Reference Linux Command Reference